align with the behavior of other variables

This commit is contained in:
root
2023-09-04 09:10:55 +00:00
parent a4f1cea227
commit 3e41071242
2 changed files with 2 additions and 1 deletions

View File

@@ -49,6 +49,7 @@ def main():
'frequency_penalty': float(os.environ.get('FREQUENCY_PENALTY', 0.0)), 'frequency_penalty': float(os.environ.get('FREQUENCY_PENALTY', 0.0)),
'bot_language': os.environ.get('BOT_LANGUAGE', 'en'), 'bot_language': os.environ.get('BOT_LANGUAGE', 'en'),
'show_plugins_used': os.environ.get('SHOW_PLUGINS_USED', 'false').lower() == 'true', 'show_plugins_used': os.environ.get('SHOW_PLUGINS_USED', 'false').lower() == 'true',
'whisper_prompt': os.environ.get('WHISPER_PROMPT', ''),
} }
if openai_config['enable_functions'] and not functions_available: if openai_config['enable_functions'] and not functions_available:

View File

@@ -341,7 +341,7 @@ class OpenAIHelper:
""" """
try: try:
with open(filename, "rb") as audio: with open(filename, "rb") as audio:
prompt_text = os.environ.get('WHISPER_PROMPT', '') prompt_text = self.config['whisper_prompt']
result = await openai.Audio.atranscribe("whisper-1", audio, prompt=prompt_text) result = await openai.Audio.atranscribe("whisper-1", audio, prompt=prompt_text)
return result.text return result.text
except Exception as e: except Exception as e: