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.
Add custom commands to execute_command via promptgenerator
BillSchumacherabb54df4d071
diff --git a/autogpt/agent/agent.py b/autogpt/agent/agent.pyindex ba3a3791e0..a3a3729a4e 100644--- a/autogpt/agent/agent.py+++ b/autogpt/agent/agent.py@@ -167,13 +167,11 @@ class Agent:)result = (f"Command {command_name} returned: "- f"{execute_command(command_name, arguments)}"+ f"{execute_command(command_name, arguments, self.config.prompt_generator)}")-+for plugin in cfg.plugins:- result = plugin.post_command(- command_name, result- )+ result = plugin.post_command(command_name, result)if self.next_action_count > 0:self.next_action_count -= 1diff --git a/autogpt/app.py b/autogpt/app.pyindex fa5cab6201..f543fd83c4 100644--- a/autogpt/app.py+++ b/autogpt/app.py@@ -21,6 +21,7 @@ from autogpt.commands.file_operations import (from autogpt.json_fixes.parsing import fix_and_parse_jsonfrom autogpt.memory import get_memoryfrom autogpt.processing.text import summarize_text+from autogpt.prompts.generator import PromptGeneratorfrom autogpt.speech import say_textfrom autogpt.commands.web_selenium import browse_websitefrom autogpt.commands.git_operations import clone_repository@@ -105,7 +106,7 @@ def map_command_synonyms(command_name: str):return command_name-def execute_command(command_name: str, arguments):+def execute_command(command_name: str, arguments, prompt: PromptGenerator):"""Execute the command and return the resultArgs:@@ -192,6 +193,9 @@ def execute_command(command_name: str, arguments):elif command_name == "task_complete":shutdown()else:+ for command in prompt.commands:+ if command_name == command["label"] or command_name == command["name"]:+ return command["function"](*arguments.values())return (f"Unknown command '{command_name}'. Please refer to the 'COMMANDS'"" list for available commands and only respond in the specified JSON"