Skip to content

AutoGPT is the vision of accessible AI for everyone, to use and to build on. Our mission is to provide the tools, so that you can focus on what matters.

Updates web browsing commands.

Torantulinoe9df13e8101a
diff --git a/AutonomousAI/commands.py b/AutonomousAI/commands.py
index 8d609d5d3f..7ac76f7410 100644
--- a/AutonomousAI/commands.py
+++ b/AutonomousAI/commands.py
@@ -54,6 +54,8 @@ def execute_command(command_name, arguments):
return get_hyperlinks(arguments["url"])
elif command_name == "write_to_file":
return write_to_file(arguments["file"], arguments["content"])
+ elif browse_website == "browse_website":
+ return browse_website(arguments["url"])
elif command_name == "task_complete":
shutdown()
else:
@@ -74,6 +76,14 @@ def google_search(query, num_results = 8):
return json.dumps(search_results, ensure_ascii=False, indent=4)
+def browse_website(url):
+ summary = get_text_summary(url)
+ links = get_hyperlinks(url)
+
+ result = f"""Website Content Summary: {summary}\n\nLinks: {links}"""
+
+ return result
+
def get_text_summary(url):
text = browse.scrape_text(url)
summary = browse.summarize_text(text)
diff --git a/AutonomousAI/data/prompt.txt b/AutonomousAI/data/prompt.txt
index 40a389694d..cf82f615ca 100644
--- a/AutonomousAI/data/prompt.txt
+++ b/AutonomousAI/data/prompt.txt
@@ -7,19 +7,16 @@ COMMANDS:
1. Google Search: "google", args: "input": "<search>"
2. Check news: "check_news", args: "source": "<news source>"
-3. Check notifications: "check_notifications", args: "website": "<website>"
-4. Memory Add: "memory_add", args: "string": "<string>"
-5. Memory Delete: "memory_del", args: "key": "<key>"
-6. Memory Overwrite: "memory_ovr", args: "key": "<key>", "string": "<string>"
+3. Memory Add: "memory_add", args: "string": "<string>"
+4. Memory Delete: "memory_del", args: "key": "<key>"
+5. Memory Overwrite: "memory_ovr", args: "key": "<key>", "string": "<string>"
+6. Browse Website: "browse_website", args: "url": "<url>"
7. Start GPT Agent: "start_agent", "task": "<short_task_desc>", "prompt": "<prompt>"
8. Message GPT Agent: "message_agent", args: "key": "<key>", "message": "<message>"
9. List GPT Agents: "list_agents", args: ""
10. Delete GPT Agent: "delete_agent", args: "key": "<key>"
-9. Navigate & Perform: "navigate_website", args: "action": "click_button/input_text/register_account", "text/username": "<text>/<username>"
-11. Get Text Summary: "get_text_summary", args: "url": "<url>"
-12. Get Outgoing Links: "get_hyperlinks", args: "url": "<url>"
-13. Write to file: "write_to_file", args: "file": "<file>", "text": "<text>"
-14. Task Complete (Shutdown): "task_complete", args: "reason": "<reason>"
+11. Write to file: "write_to_file", args: "file": "<file>", "text": "<text>"
+12. Task Complete (Shutdown): "task_complete", args: "reason": "<reason>"
RESOURCES: