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.

Remove write_tests command (#4707)

merwanehamadia30e5a85b266
diff --git a/autogpt/commands/improve_code.py b/autogpt/commands/improve_code.py
deleted file mode 100644
index d4f87782ce..0000000000
--- a/autogpt/commands/improve_code.py
+++ /dev/null
@@ -1,38 +0,0 @@
-from __future__ import annotations
-
-import json
-
-from autogpt.agent.agent import Agent
-from autogpt.command_decorator import command
-from autogpt.llm.utils import call_ai_function
-
-
-@command(
- "improve_code",
- "Get Improved Code",
- '"suggestions": "<list_of_suggestions>", "code": "<full_code_string>"',
-)
-def improve_code(suggestions: list[str], code: str, agent: Agent) -> str:
- """
- A function that takes in code and suggestions and returns a response from create
- chat completion api call.
-
- Parameters:
- suggestions (list): A list of suggestions around what needs to be improved.
- code (str): Code to be improved.
- Returns:
- A result string from create chat completion. Improved code in response.
- """
-
- function_string = (
- "def generate_improved_code(suggestions: list[str], code: str) -> str:"
- )
- args = [json.dumps(suggestions), code]
- description_string = (
- "Improves the provided code based on the suggestions"
- " provided, making no other changes."
- )
-
- return call_ai_function(
- function_string, args, description_string, config=agent.config
- )
diff --git a/autogpt/commands/write_tests.py b/autogpt/commands/write_tests.py
deleted file mode 100644
index 881b6ac4f1..0000000000
--- a/autogpt/commands/write_tests.py
+++ /dev/null
@@ -1,40 +0,0 @@
-"""A module that contains a function to generate test cases for the submitted code."""
-from __future__ import annotations
-
-import json
-
-from autogpt.agent.agent import Agent
-from autogpt.command_decorator import command
-from autogpt.llm.utils import call_ai_function
-
-
-@command(
- "write_tests",
- "Write Tests",
- '"code": "<full_code_string>", "focus": "<list_of_focus_areas>"',
-)
-def write_tests(code: str, focus: list[str], agent: Agent) -> str:
- """
- A function that takes in code and focus topics and returns a response from create
- chat completion api call.
-
- Parameters:
- focus (list): A list of suggestions around what needs to be improved.
- code (str): Code for test cases to be generated against.
- Returns:
- A result string from create chat completion. Test cases for the submitted code
- in response.
- """
-
- function_string = (
- "def create_test_cases(code: str, focus: Optional[str] = None) -> str:"
- )
- args = [code, json.dumps(focus)]
- description_string = (
- "Generates test cases for the existing code, focusing on"
- " specific areas if required."
- )
-
- return call_ai_function(
- function_string, args, description_string, config=agent.config
- )
diff --git a/autogpt/main.py b/autogpt/main.py
index de12403465..a623845719 100644
--- a/autogpt/main.py
+++ b/autogpt/main.py
@@ -29,9 +29,7 @@ COMMAND_CATEGORIES = [
"autogpt.commands.git_operations",
"autogpt.commands.google_search",
"autogpt.commands.image_gen",
- "autogpt.commands.improve_code",
"autogpt.commands.web_selenium",
- "autogpt.commands.write_tests",
"autogpt.app",
"autogpt.commands.task_statuses",
]
diff --git a/tests/challenges/current_score.json b/tests/challenges/current_score.json
index 4d747f0359..732e739176 100644
--- a/tests/challenges/current_score.json
+++ b/tests/challenges/current_score.json
@@ -2,7 +2,7 @@
"basic_abilities": {
"browse_website": {
"max_level": 1,
- "max_level_beaten": 1
+ "max_level_beaten": null
},
"write_file": {
"max_level": 2,