wip parametrize model name

This commit is contained in:
lebaudantoine
2024-11-29 17:51:44 +01:00
parent ad99db4706
commit 2ee5caa0dc
2 changed files with 4 additions and 2 deletions
+2 -2
View File
@@ -90,7 +90,7 @@ def send_push_notification(filename: str, email: str, sub: str):
logger.debug("Querying transcription …")
with open(temp_file_path, "rb") as audio_file:
transcription = openai_client.audio.transcriptions.create(
model="whisper-1", file=audio_file
model=settings.openai_asr_model, file=audio_file
)
transcription = transcription.text
@@ -99,7 +99,7 @@ def send_push_notification(filename: str, email: str, sub: str):
instructions = get_instructions(transcription)
summary_response = openai_client.chat.completions.create(
model="gpt-4o", messages=instructions
model=settings.openai_llm_model, messages=instructions
)
summary = summary_response.choices[0].message.content
+2
View File
@@ -28,6 +28,8 @@ class Settings(BaseSettings):
# AI-related settings
openai_api_key: str
openai_base_url: str = "https://api.openai.com/v1"
openai_asr_model: str = "whisper-1"
openai_llm_model: str = "gpt-4o"
# Webhook-related settings
webhook_max_retries: int = 2