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.

Only add audio to text command to the prompt if model is set

HDKiller405632f187f0
diff --git a/autogpt/prompt.py b/autogpt/prompt.py
index 97bacb711d..5cc98cd36d 100644
--- a/autogpt/prompt.py
+++ b/autogpt/prompt.py
@@ -82,10 +82,19 @@ def get_prompt() -> str:
),
("Execute Python File", "execute_python_file", {"file": "<file>"}),
("Generate Image", "generate_image", {"prompt": "<prompt>"}),
- ("Convert Audio to text", "read_audio_from_file", {"file": "<file>"}),
("Send Tweet", "send_tweet", {"text": "<text>"}),
]
+ # Only add the audio to text command if the model is specified
+ if cfg.huggingface_audio_to_text_model:
+ commands.append(
+ (
+ "Convert Audio to text",
+ "read_audio_from_file",
+ {"file": "<file>"}
+ ),
+ )
+
# Only add shell command to the prompt if the AI is allowed to execute it
if cfg.execute_local_commands:
commands.append(