diff --git a/src/summary/summary/celery_worker.py b/src/summary/summary/celery_worker.py index 801cc5fe..213ba699 100644 --- a/src/summary/summary/celery_worker.py +++ b/src/summary/summary/celery_worker.py @@ -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 diff --git a/src/summary/summary/config.py b/src/summary/summary/config.py index d53b0308..b3de263f 100644 --- a/src/summary/summary/config.py +++ b/src/summary/summary/config.py @@ -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