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 analyze_code (#4705)

merwanehamadi512d7ba2089d
diff --git a/.gitignore b/.gitignore
index 307a672373..29a0285a86 100644
--- a/.gitignore
+++ b/.gitignore
@@ -32,6 +32,7 @@ build/
develop-eggs/
dist/
plugins/
+plugins_config.yaml
downloads/
eggs/
.eggs/
diff --git a/autogpt/commands/analyze_code.py b/autogpt/commands/analyze_code.py
deleted file mode 100644
index cd176a9aa5..0000000000
--- a/autogpt/commands/analyze_code.py
+++ /dev/null
@@ -1,34 +0,0 @@
-"""Code evaluation module."""
-from __future__ import annotations
-
-from autogpt.agent.agent import Agent
-from autogpt.command_decorator import command
-from autogpt.llm.utils import call_ai_function
-
-
-@command(
- "analyze_code",
- "Analyze Code",
- '"code": "<full_code_string>"',
-)
-def analyze_code(code: str, agent: Agent) -> list[str]:
- """
- A function that takes in a string and returns a response from create chat
- completion api call.
-
- Parameters:
- code (str): Code to be evaluated.
- Returns:
- A result string from create chat completion. A list of suggestions to
- improve the code.
- """
-
- function_string = "def analyze_code(code: str) -> list[str]:"
- args = [code]
- description_string = (
- "Analyzes the given code and returns a list of suggestions for improvements."
- )
-
- return call_ai_function(
- function_string, args, description_string, config=agent.config
- )
diff --git a/autogpt/main.py b/autogpt/main.py
index 97baa7b28b..de12403465 100644
--- a/autogpt/main.py
+++ b/autogpt/main.py
@@ -23,7 +23,6 @@ from autogpt.workspace import Workspace
from scripts.install_plugin_deps import install_plugin_dependencies
COMMAND_CATEGORIES = [
- "autogpt.commands.analyze_code",
"autogpt.commands.audio_text",
"autogpt.commands.execute_code",
"autogpt.commands.file_operations",
diff --git a/docs/configuration/options.md b/docs/configuration/options.md
index b2cbf6bc76..07e76c6881 100644
--- a/docs/configuration/options.md
+++ b/docs/configuration/options.md
@@ -10,7 +10,7 @@ Configuration is controlled through the `Config` object. You can set configurati
- `BROWSE_CHUNK_MAX_LENGTH`: When browsing website, define the length of chunks to summarize. Default: 3000
- `BROWSE_SPACY_LANGUAGE_MODEL`: [spaCy language model](https://spacy.io/usage/models) to use when creating chunks. Default: en_core_web_sm
- `CHAT_MESSAGES_ENABLED`: Enable chat messages. Optional
-- `DISABLED_COMMAND_CATEGORIES`: Command categories to disable. Command categories are Python module names, e.g. autogpt.commands.analyze_code. See the directory `autogpt/commands` in the source for all command modules. Default: None
+- `DISABLED_COMMAND_CATEGORIES`: Command categories to disable. Command categories are Python module names, e.g. autogpt.commands.execute_code. See the directory `autogpt/commands` in the source for all command modules. Default: None
- `ELEVENLABS_API_KEY`: ElevenLabs API Key. Optional.
- `ELEVENLABS_VOICE_ID`: ElevenLabs Voice ID. Optional.
- `EMBEDDING_MODEL`: LLM Model to use for embedding tasks. Default: text-embedding-ada-002
@@ -50,4 +50,4 @@ Configuration is controlled through the `Config` object. You can set configurati
- `USER_AGENT`: User-Agent given when browsing websites. Default: "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.97 Safari/537.36"
- `USE_AZURE`: Use Azure's LLM Default: False
- `USE_WEB_BROWSER`: Which web browser to use. Options are `chrome`, `firefox`, `safari` or `edge` Default: chrome
-- `WIPE_REDIS_ON_START`: Wipes data / index on start. Default: True
\ No newline at end of file
+- `WIPE_REDIS_ON_START`: Wipes data / index on start. Default: True
diff --git a/docs/usage.md b/docs/usage.md
index 011f5f8a51..93dfd25f49 100644
--- a/docs/usage.md
+++ b/docs/usage.md
@@ -104,5 +104,5 @@ If you want to selectively disable some command groups, you can use the `DISABLE
For example, to disable coding related features, set it to the value below:
```ini
-DISABLED_COMMAND_CATEGORIES=autogpt.commands.analyze_code,autogpt.commands.execute_code,autogpt.commands.git_operations,autogpt.commands.improve_code,autogpt.commands.write_tests
+DISABLED_COMMAND_CATEGORIES=autogpt.commands.execute_code,autogpt.commands.git_operations,autogpt.commands.improve_code,autogpt.commands.write_tests
```