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.
Fix agent remembering do nothing command, use correct google function, disabled image_gen if not configured.
BillSchumacherc0aa423d7b65
diff --git a/autogpt/agent/agent.py b/autogpt/agent/agent.pyindex b771b1de48..65ca3c96ff 100644--- a/autogpt/agent/agent.py+++ b/autogpt/agent/agent.py@@ -187,24 +187,24 @@ class Agent:result = plugin.post_command(command_name, result)if self.next_action_count > 0:self.next_action_count -= 1+ if command_name != "do_nothing":+ memory_to_add = (+ f"Assistant Reply: {assistant_reply} "+ f"\nResult: {result} "+ f"\nHuman Feedback: {user_input} "+ )- memory_to_add = (- f"Assistant Reply: {assistant_reply} "- f"\nResult: {result} "- f"\nHuman Feedback: {user_input} "- )-- self.memory.add(memory_to_add)+ self.memory.add(memory_to_add)- # Check if there's a result from the command append it to the message- # history- if result is not None:- self.full_message_history.append(create_chat_message("system", result))- logger.typewriter_log("SYSTEM: ", Fore.YELLOW, result)- else:- self.full_message_history.append(- create_chat_message("system", "Unable to execute command")- )- logger.typewriter_log(- "SYSTEM: ", Fore.YELLOW, "Unable to execute command"- )+ # Check if there's a result from the command append it to the message+ # history+ if result is not None:+ self.full_message_history.append(create_chat_message("system", result))+ logger.typewriter_log("SYSTEM: ", Fore.YELLOW, result)+ else:+ self.full_message_history.append(+ create_chat_message("system", "Unable to execute command")+ )+ logger.typewriter_log(+ "SYSTEM: ", Fore.YELLOW, "Unable to execute command"+ )diff --git a/autogpt/commands/google_search.py b/autogpt/commands/google_search.pyindex 0f635bcadc..f549ae8f6e 100644--- a/autogpt/commands/google_search.py+++ b/autogpt/commands/google_search.py@@ -11,7 +11,7 @@ from autogpt.config import ConfigCFG = Config()-@command("google", "Google Search", '"input": "<search>"', not CFG.google_api_key)+@command("google", "Google Search", '"query": "<search>"', not CFG.google_api_key)def google_search(query: str, num_results: int = 8) -> str:"""Return the results of a google search@@ -40,7 +40,7 @@ def google_search(query: str, num_results: int = 8) -> str:@command("google","Google Search",- '"input": "<search>"',+ '"query": "<search>"',bool(CFG.google_api_key),"Configure google_api_key.",)diff --git a/autogpt/commands/image_gen.py b/autogpt/commands/image_gen.pyindex 9dbb2fa586..ada285e721 100644--- a/autogpt/commands/image_gen.py+++ b/autogpt/commands/image_gen.py@@ -14,7 +14,8 @@ from autogpt.workspace import path_in_workspaceCFG = Config()-@command("generate_image", "Generate Image", '"prompt": "<prompt>"')+@command("generate_image", "Generate Image", '"prompt": "<prompt>"',+ CFG.image_provider)def generate_image(prompt: str) -> str:"""Generate an image from a prompt.