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.
Fixes LLM thinking command descriptions are orders
Merwane Hamadif4c000a547e5
diff --git a/autogpt/commands/execute_code.py b/autogpt/commands/execute_code.pyindex 0b0f731c91..2db78ccca8 100644--- a/autogpt/commands/execute_code.py+++ b/autogpt/commands/execute_code.py@@ -18,7 +18,7 @@ DENYLIST_CONTROL = "denylist"@command("execute_python_code",- "Create a Python file and execute it",+ "Creates a Python file and executes it",{"code": {"type": "string",@@ -63,7 +63,7 @@ def execute_python_code(code: str, name: str, agent: Agent) -> str:@command("execute_python_file",- "Execute an existing Python file",+ "Executes an existing Python file",{"filename": {"type": "string",@@ -191,7 +191,7 @@ def validate_command(command: str, config: Config) -> bool:@command("execute_shell",- "Execute Shell Command, non-interactive commands only",+ "Executes a Shell Command, non-interactive commands only",{"command_line": {"type": "string",@@ -237,7 +237,7 @@ def execute_shell(command_line: str, agent: Agent) -> str:@command("execute_shell_popen",- "Execute Shell Command, non-interactive commands only",+ "Executes a Shell Command, non-interactive commands only",{"query": {"type": "string",diff --git a/autogpt/commands/file_operations.py b/autogpt/commands/file_operations.pyindex d059493f09..ca24874393 100644--- a/autogpt/commands/file_operations.py+++ b/autogpt/commands/file_operations.py@@ -176,7 +176,7 @@ def ingest_file(@command("write_to_file",- "Write to file",+ "Writes to a file",{"filename": {"type": "string",@@ -216,7 +216,7 @@ def write_to_file(filename: str, text: str, agent: Agent) -> str:@command("append_to_file",- "Append to file",+ "Appends to a file",{"filename": {"type": "string",@@ -261,7 +261,7 @@ def append_to_file(@command("delete_file",- "Delete file",+ "Deletes a file",{"filename": {"type": "string",@@ -291,7 +291,7 @@ def delete_file(filename: str, agent: Agent) -> str:@command("list_files",- "List Files in Directory",+ "Lists Files in a Directory",{"directory": {"type": "string",diff --git a/autogpt/commands/git_operations.py b/autogpt/commands/git_operations.pyindex 3832ca885f..fc967e40eb 100644--- a/autogpt/commands/git_operations.py+++ b/autogpt/commands/git_operations.py@@ -9,7 +9,7 @@ from autogpt.url_utils.validators import validate_url@command("clone_repository",- "Clone Repository",+ "Clones a Repository",{"url": {"type": "string",diff --git a/autogpt/commands/image_gen.py b/autogpt/commands/image_gen.pyindex d6bb73d8a3..c295392c60 100644--- a/autogpt/commands/image_gen.py+++ b/autogpt/commands/image_gen.py@@ -16,7 +16,7 @@ from autogpt.logs import logger@command("generate_image",- "Generate Image",+ "Generates an Image",{"prompt": {"type": "string",diff --git a/autogpt/commands/web_search.py b/autogpt/commands/web_search.pyindex 50b06e4805..5af8105869 100644--- a/autogpt/commands/web_search.py+++ b/autogpt/commands/web_search.py@@ -15,7 +15,7 @@ DUCKDUCKGO_MAX_ATTEMPTS = 3@command("web_search",- "Search the web",+ "Searches the web",{"query": {"type": "string",diff --git a/autogpt/commands/web_selenium.py b/autogpt/commands/web_selenium.pyindex 471e203b74..821957f3e0 100644--- a/autogpt/commands/web_selenium.py+++ b/autogpt/commands/web_selenium.py@@ -41,7 +41,7 @@ FILE_DIR = Path(__file__).parent.parent@command("browse_website",- "Browse Website",+ "Browses a Website",{"url": {"type": "string", "description": "The URL to visit", "required": True},"question": {diff --git a/autogpt/llm/api_manager.py b/autogpt/llm/api_manager.pyindex afab6e4ae6..4e2aba9d22 100644--- a/autogpt/llm/api_manager.py+++ b/autogpt/llm/api_manager.py@@ -4,6 +4,7 @@ from typing import List, Optionalimport openaifrom openai import Model+from autogpt.llm.base import CompletionModelInfofrom autogpt.logs import loggerfrom autogpt.singleton import Singleton@@ -35,6 +36,7 @@ class ApiManager(metaclass=Singleton):"""# the .model property in API responses can contain version suffixes like -v2from autogpt.llm.providers.openai import OPEN_AI_MODELS+model = model[:-3] if model.endswith("-v2") else modelmodel_info = OPEN_AI_MODELS[model]diff --git a/autogpt/llm/providers/openai.py b/autogpt/llm/providers/openai.pyindex 707a7db8ac..add9954c6b 100644--- a/autogpt/llm/providers/openai.py+++ b/autogpt/llm/providers/openai.py@@ -111,6 +111,7 @@ OPEN_AI_MODELS: dict[str, ChatModelInfo | EmbeddingModelInfo | TextModelInfo] =def meter_api(func):"""Adds ApiManager metering to functions which make OpenAI API calls"""from autogpt.llm.api_manager import ApiManager+api_manager = ApiManager()openai_obj_processor = openai.util.convert_to_openai_objectdiff --git a/tests/unit/test_api_manager.py b/tests/unit/test_api_manager.pyindex 04242d576d..615204d19b 100644--- a/tests/unit/test_api_manager.py+++ b/tests/unit/test_api_manager.py@@ -1,4 +1,4 @@-from unittest.mock import MagicMock, patch+from unittest.mock import patchimport pytestfrom pytest_mock import MockerFixture