mirror of
https://github.com/aljazceru/chatgpt-telegram-bot.git
synced 2025-12-22 23:25:41 +01:00
align with the behavior of other variables
This commit is contained in:
@@ -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:
|
||||||
|
|||||||
@@ -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:
|
||||||
|
|||||||
Reference in New Issue
Block a user