Merge pull request #1826 from hdkiller/add-only-to-prompt-if-model-is-set

Only add audio to text command to the prompt if model is set
This commit is contained in:
BillSchumacher
2023-04-16 04:05:29 -05:00
committed by GitHub

View File

@@ -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(