diff --git a/AutonomousAI/commands.py b/AutonomousAI/commands.py index 8d609d5d..7ac76f74 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 40a38969..cf82f615 100644 --- a/AutonomousAI/data/prompt.txt +++ b/AutonomousAI/data/prompt.txt @@ -7,19 +7,16 @@ COMMANDS: 1. Google Search: "google", args: "input": "" 2. Check news: "check_news", args: "source": "" -3. Check notifications: "check_notifications", args: "website": "" -4. Memory Add: "memory_add", args: "string": "" -5. Memory Delete: "memory_del", args: "key": "" -6. Memory Overwrite: "memory_ovr", args: "key": "", "string": "" +3. Memory Add: "memory_add", args: "string": "" +4. Memory Delete: "memory_del", args: "key": "" +5. Memory Overwrite: "memory_ovr", args: "key": "", "string": "" +6. Browse Website: "browse_website", args: "url": "" 7. Start GPT Agent: "start_agent", "task": "", "prompt": "" 8. Message GPT Agent: "message_agent", args: "key": "", "message": "" 9. List GPT Agents: "list_agents", args: "" 10. Delete GPT Agent: "delete_agent", args: "key": "" -9. Navigate & Perform: "navigate_website", args: "action": "click_button/input_text/register_account", "text/username": "/" -11. Get Text Summary: "get_text_summary", args: "url": "" -12. Get Outgoing Links: "get_hyperlinks", args: "url": "" -13. Write to file: "write_to_file", args: "file": "", "text": "" -14. Task Complete (Shutdown): "task_complete", args: "reason": "" +11. Write to file: "write_to_file", args: "file": "", "text": "" +12. Task Complete (Shutdown): "task_complete", args: "reason": "" RESOURCES: