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.
remove do nothing (#3369)
merwanehamadia3195d84d3be
diff --git a/autogpt/agent/agent.py b/autogpt/agent/agent.pyindex 6dd5918b8b..9b48d540dc 100644--- a/autogpt/agent/agent.py+++ b/autogpt/agent/agent.py@@ -252,29 +252,26 @@ 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"+ )def _resolve_pathlike_command_args(self, command_args):if "directory" in command_args and command_args["directory"] in {"", "/"}:diff --git a/autogpt/app.py b/autogpt/app.pyindex 6bcc851b4a..3bbf6581db 100644--- a/autogpt/app.py+++ b/autogpt/app.py@@ -119,8 +119,6 @@ def execute_command(# TODO: Change these to take in a file rather than pasted code, if# non-file is given, return instructions "Input should be a python# filepath, write your code to file and try again- elif command_name == "do_nothing":- return f"Error: No action performed. Reason: {arguments['reason']}"elif command_name == "task_complete":shutdown()else:diff --git a/autogpt/prompts/generator.py b/autogpt/prompts/generator.pyindex 282b9d72ac..2ae9123b23 100644--- a/autogpt/prompts/generator.py+++ b/autogpt/prompts/generator.py@@ -127,7 +127,7 @@ class PromptGenerator:for item in self.command_registry.commands.values()if item.enabled]- # These are the commands that are added manually, do_nothing and terminate+ # terminate command is added manuallycommand_strings += [self._generate_command_string(item) for item in items]return "\n".join(f"{i+1}. {item}" for i, item in enumerate(command_strings))else:diff --git a/autogpt/prompts/prompt.py b/autogpt/prompts/prompt.pyindex 68d8a3362e..b20a175776 100644--- a/autogpt/prompts/prompt.py+++ b/autogpt/prompts/prompt.py@@ -39,7 +39,6 @@ def build_default_prompt_generator() -> PromptGenerator:# Define the command listcommands = [- ("Do Nothing", "do_nothing", {"reason": "<reason>"}),("Task Complete (Shutdown)", "task_complete", {"reason": "<reason>"}),]diff --git a/tests/integration/goal_oriented/cassettes/test_write_file/test_write_file.yaml b/tests/integration/goal_oriented/cassettes/test_write_file/test_write_file.yamlindex 482042f8f2..7d21c210da 100644--- a/tests/integration/goal_oriented/cassettes/test_write_file/test_write_file.yaml+++ b/tests/integration/goal_oriented/cassettes/test_write_file/test_write_file.yaml@@ -23,17 +23,16 @@ interactions:\"question\": \"<question>\"\n9. list_agents: List GPT Agents, args: () -> str\n10.message_agent: Message GPT Agent, args: \"key\": \"<key>\", \"message\": \"<message>\"\n11.start_agent: Start GPT Agent, args: \"name\": \"<name>\", \"task\": \"<short_task_desc>\",- \"prompt\": \"<prompt>\"\n12. Do Nothing: \"do_nothing\", args: \"reason\":- \"<reason>\"\n13. Task Complete (Shutdown): \"task_complete\", args: \"reason\":- \"<reason>\"\n\nResources:\n1. Internet access for searches and information- gathering.\n2. Long Term memory management.\n3. GPT-3.5 powered Agents for delegation- of simple tasks.\n4. File output.\n\nPerformance Evaluation:\n1. Continuously- review and analyze your actions to ensure you are performing to the best of- your abilities.\n2. Constructively self-criticize your big-picture behavior- constantly.\n3. Reflect on past decisions and strategies to refine your approach.\n4.- Every command has a cost, so be smart and efficient. Aim to complete tasks in- the least number of steps.\n5. Write all code to a file.\n\nYou should only- respond in JSON format as described below \nResponse Format: \n{\n \"thoughts\":+ \"prompt\": \"<prompt>\"\n12. Task Complete (Shutdown): \"task_complete\", args:+ \"reason\": \"<reason>\"\n\nResources:\n1. Internet access for searches and+ information gathering.\n2. Long Term memory management.\n3. GPT-3.5 powered+ Agents for delegation of simple tasks.\n4. File output.\n\nPerformance Evaluation:\n1.+ Continuously review and analyze your actions to ensure you are performing to+ the best of your abilities.\n2. Constructively self-criticize your big-picture+ behavior constantly.\n3. Reflect on past decisions and strategies to refine+ your approach.\n4. Every command has a cost, so be smart and efficient. Aim+ to complete tasks in the least number of steps.\n5. Write all code to a file.\n\nYou+ should only respond in JSON format as described below \nResponse Format: \n{\n \"thoughts\":{\n \"text\": \"thought\",\n \"reasoning\": \"reasoning\",\n \"plan\":\"- short bulleted\\n- list that conveys\\n- long-term plan\",\n \"criticism\":\"constructive self-criticism\",\n \"speak\": \"thoughts summary to say@@ -43,7 +42,7 @@ interactions:time and date is Tue Jan 01 00:00:00 2000"}, {"role": "system", "content": "Thisreminds you of these events from your past:\n\n\n"}, {"role": "user", "content":"Determine which next command to use, and respond using the format specified- above:"}], "temperature": 0, "max_tokens": 3205}'+ above:"}], "temperature": 0, "max_tokens": 3223}'headers:Accept:- '*/*'@@ -52,7 +51,7 @@ interactions:Connection:- keep-aliveContent-Length:- - '3554'+ - '3490'Content-Type:- application/jsonmethod: POST@@ -60,20 +59,20 @@ interactions:response:body:string: !!binary |- H4sIAAAAAAAAA7yTQW/aQBCF7/0Vo7lwMQgIKeBbemmjtlIPtFFUV2hZD/aW9Y6zOy5IyP+9MjYh- ccWpVa/zxu99zx4f0aQYo86V6KK0w/lSr+6eZl8W04P6fNh8evdkH2x59/jx/exbhhHy5idp6Z4Y- aS5KS2LYYYTakxJKMZ68XUxvp/PJYhZhwSlZjDErZXgzuh1K5Tc8HN+MJxhhFVRGGB+x9FyUshbe- kQsYz5fTCC/ez/PJch6hsCj7PFoulnWEOmejKWD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3wAAAP//AwAxpIznhgQAAA==headers:CF-Cache-Status:- DYNAMICCF-RAY:- - 7be04376c97296c3-SJC+ - 7be2da273c20ce54-SJCCache-Control:- no-cache, must-revalidateConnection:@@ -83,7 +82,7 @@ interactions:Content-Type:- application/jsonDate:- - Wed, 26 Apr 2023 16:40:03 GMT+ - Thu, 27 Apr 2023 00:12:22 GMTServer:- cloudflareaccess-control-allow-origin:@@ -95,7 +94,7 @@ interactions:openai-organization:- user-adtx4fhfg1qsiyzdoaxcioojopenai-processing-ms:- - '18864'+ - '14714'openai-version:- '2020-10-01'strict-transport-security:@@ -107,7 +106,7 @@ interactions:x-ratelimit-reset-requests:- 17msx-request-id:- - 77d98331ebd579dd929c8de10a83a035+ - 23366aac1ddcc141fc735b4a1a8b268cstatus:code: 200message: OK@@ -135,17 +134,16 @@ interactions:\"question\": \"<question>\"\n9. list_agents: List GPT Agents, args: () -> str\n10.message_agent: Message GPT Agent, args: \"key\": \"<key>\", \"message\": \"<message>\"\n11.start_agent: Start GPT Agent, args: \"name\": \"<name>\", \"task\": \"<short_task_desc>\",- \"prompt\": \"<prompt>\"\n12. Do Nothing: \"do_nothing\", args: \"reason\":- \"<reason>\"\n13. Task Complete (Shutdown): \"task_complete\", args: \"reason\":- \"<reason>\"\n\nResources:\n1. Internet access for searches and information- gathering.\n2. Long Term memory management.\n3. GPT-3.5 powered Agents for delegation- of simple tasks.\n4. File output.\n\nPerformance Evaluation:\n1. Continuously- review and analyze your actions to ensure you are performing to the best of- your abilities.\n2. Constructively self-criticize your big-picture behavior- constantly.\n3. Reflect on past decisions and strategies to refine your approach.\n4.- Every command has a cost, so be smart and efficient. Aim to complete tasks in- the least number of steps.\n5. Write all code to a file.\n\nYou should only- respond in JSON format as described below \nResponse Format: \n{\n \"thoughts\":+ \"prompt\": \"<prompt>\"\n12. Task Complete (Shutdown): \"task_complete\", args:+ \"reason\": \"<reason>\"\n\nResources:\n1. Internet access for searches and+ information gathering.\n2. Long Term memory management.\n3. GPT-3.5 powered+ Agents for delegation of simple tasks.\n4. File output.\n\nPerformance Evaluation:\n1.+ Continuously review and analyze your actions to ensure you are performing to+ the best of your abilities.\n2. Constructively self-criticize your big-picture+ behavior constantly.\n3. Reflect on past decisions and strategies to refine+ your approach.\n4. Every command has a cost, so be smart and efficient. Aim+ to complete tasks in the least number of steps.\n5. Write all code to a file.\n\nYou+ should only respond in JSON format as described below \nResponse Format: \n{\n \"thoughts\":{\n \"text\": \"thought\",\n \"reasoning\": \"reasoning\",\n \"plan\":\"- short bulleted\\n- list that conveys\\n- long-term plan\",\n \"criticism\":\"constructive self-criticism\",\n \"speak\": \"thoughts summary to say@@ -158,17 +156,18 @@ interactions:above:"}, {"role": "assistant", "content": "{\n \"thoughts\": {\n \"text\":\"I will use the write_to_file command to write ''Hello World'' into a filenamed ''hello_world.txt''.\",\n \"reasoning\": \"The goal is to write- ''Hello World'' into a file named ''hello_world.txt''. The write_to_file command- is the most appropriate command for this task.\",\n \"plan\": \"- Use+ ''Hello World'' into a file named ''hello_world.txt'', and the write_to_file+ command is the most appropriate for this task.\",\n \"plan\": \"- Usethe write_to_file command to write ''Hello World'' into a file named ''hello_world.txt''.\",\n \"criticism\":- \"I need to ensure that I have the correct arguments for the write_to_file command.\",\n \"speak\":- \"I will use the write to file command to write ''Hello World'' into a file- named ''hello_world.txt''.\"\n },\n \"command\": {\n \"name\":- \"write_to_file\",\n \"args\": {\n \"filename\": \"hello_world.txt\",\n \"text\":- \"Hello World\"\n }\n }\n}"}, {"role": "system", "content": "Command- write_to_file returned: File written to successfully."}, {"role": "user", "content":- "Determine which next command to use, and respond using the format specified- above:"}], "temperature": 0, "max_tokens": 2955}'+ \"I need to ensure that I am using the correct file name and that the text is+ written correctly.\",\n \"speak\": \"I will use the write to file command+ to write ''Hello World'' into a file named ''hello_world.txt''.\"\n },\n \"command\":+ {\n \"name\": \"write_to_file\",\n \"args\": {\n \"filename\":+ \"hello_world.txt\",\n \"text\": \"Hello World\"\n }\n }\n}"},+ {"role": "system", "content": "Command write_to_file returned: File written+ to successfully."}, {"role": "user", "content": "Determine which next command+ to use, and respond using the format specified above:"}], "temperature": 0,+ "max_tokens": 2970}'headers:Accept:- '*/*'@@ -177,7 +176,7 @@ interactions:Connection:- keep-aliveContent-Length:- - '4667'+ - '4612'Content-Type:- application/jsonmethod: POST@@ -185,20 +184,19 @@ interactions:response:body:string: !!binary |- H4sIAAAAAAAAA6SS3W7aQBCF7/sUo7nhxiDApaR+gsBNG4n0R3WENuvB3rLesXbHgQr53SvHJlAS- pEi9nTNz5pvdc0CTYYK6UKLLyg7nn/Xq29OCfqrFF728i5c/vtq7eJHH98vdLUbIj79JSz8x0lxW- lsSwwwi1JyWUYTL5dDOdTefT8SzCkjOymGBeyTAezYZS+0cejuPxBCOsg8oJkwNWnstK1sJbcgGT- yTiOIzyZn4TZxwiFRdlTaXIzbyLUBRtNAZNfBywpHI09W8IEVQgmiHLSYrITcu0Jh9QBAKQoBdd5- ISHFBPpiL9Be2mKKC9gZa6EOBFIQiArbdQ9IoLkslctAGF5qx65RitG5pScV2BmXd76rgiBnZcGE- N8eBN7DzRozLYXBL1jJ8Z2+zARgnDAo2xhI4VVIGg6LV17tWH8leBiNYXWVt9xUEJQcBVVWeK2/U- mb5hD1K0XW8cUVnlOv4h3P/3k+j2Pm1CeXxqR/Q8SS7Uvp1TAgso1FPnodl70gLK53VJTkIPe4Xh- cl2oSG2v/iq894TOsomOIerbX2Wo/Ztu2z90F1DK55fxO89LH5ZzvgxCrTWFsKmt/fMC9AzVs6Wu- wSbCjXEmFOvOCRMMwhVGaFxGe0zGzUPz4S8AAAD//wMARSTZRwcEAAA=+ H4sIAAAAAAAAA6SSQW8TMRCF7/yK0ZydKkuSttkbAiGFA+JQBIKtItc7Wbvx2pZnFoqi/e9om00T+ QishcZ3x++bNPO/Q1ViisVpMm/zkann/9b3JZnm1XMnHmzfLd7b4IrL6xB++vUWF8e6ejIyKCxPb+ 5ElcDKjQZNJCNZbF5fXrxWI+my8UtrEmjyU2SSazi8VEunwXJ9PZtECFHeuGsNxhyrFNspa4pcBY+ FtPiWuERfmzMLhVKFO2PpWIx7xUaG50hxvL7DlviAzhHT1iiZnYsOshgMwahMKywqwIAQIViY9dY+ 4QpLGItjgx5kKFa4gp/Oe+iYQCyBaN6uR4MEJratDjVIhKfa4dVFheoUmUlzDC40e+6NJWii9uD4+ WbmCR/CLIweZJWgjC+iUckzZaSHYxAxih+4zHpLXYT9+Ap//eyOTnTjjuD1cKhA9KilwlwedFliB+ 1T/oCXZcCbgzhpg3nfe/ztGcSG9fDAD+1e4e2atD3uPzv+IOuqX9tD+ucWZK5+b8p5xGO+Z66q8++ X/Ko7EdvVeixV7hxwbFd70lYIktMqNCFmh6wnPa3/avfAAAA//8DAKZ6myqyAwAAheaders:CF-Cache-Status:- DYNAMICCF-RAY:- - 7be043fc3bba96c3-SJC+ - 7be2da943bd5ce54-SJCCache-Control:- no-cache, must-revalidateConnection:@@ -208,7 +206,7 @@ interactions:Content-Type:- application/jsonDate:- - Wed, 26 Apr 2023 16:40:20 GMT+ - Thu, 27 Apr 2023 00:12:36 GMTServer:- cloudflareaccess-control-allow-origin:@@ -220,7 +218,7 @@ interactions:openai-organization:- user-adtx4fhfg1qsiyzdoaxcioojopenai-processing-ms:- - '15127'+ - '10505'openai-version:- '2020-10-01'strict-transport-security:@@ -232,7 +230,7 @@ interactions:x-ratelimit-reset-requests:- 17msx-request-id:- - 468c3c77efd74e3a2d396ef6033a5602+ - f593fff7d415793b53e5124283ad25c9status:code: 200message: OK