mirror of
https://github.com/aljazceru/Auto-GPT.git
synced 2025-12-18 14:34:23 +01:00
Adding most basic URL validation in scrape_text
This commit is contained in:
@@ -6,6 +6,10 @@ from llm_utils import create_chat_completion
|
||||
cfg = Config()
|
||||
|
||||
def scrape_text(url):
|
||||
# Most basic check if the URL is valid:
|
||||
if not url.startswith('http'):
|
||||
return "Error: Invalid URL"
|
||||
|
||||
try:
|
||||
response = requests.get(url, headers=cfg.user_agent_header)
|
||||
except requests.exceptions.RequestException as e:
|
||||
|
||||
Reference in New Issue
Block a user