🔧(backend) rename OpenAI settings to WhisperX to avoid confusion

Rename incorrectly named OpenAI configuration settings since
they're used to instantiate WhisperX client which is not OpenAI
compatible, preventing confusion about actual service dependencies.
This commit is contained in:
lebaudantoine
2025-09-09 18:21:22 +02:00
committed by aleb_the_flash
parent 0102b428f1
commit bfdf5548a0
7 changed files with 33 additions and 37 deletions

View File

@@ -114,7 +114,7 @@ class MetadataManager:
initial_metadata = {
"start_time": time.time(),
"asr_model": settings.openai_asr_model,
"asr_model": settings.whisperx_asr_model,
"retries": 0,
}

View File

@@ -215,19 +215,19 @@ def process_audio_transcribe_summarize_v2(
logger.error(error_msg)
raise AudioValidationError(error_msg)
logger.info("Initiating OpenAI client")
openai_client = openai.OpenAI(
api_key=settings.openai_api_key,
base_url=settings.openai_base_url,
max_retries=settings.openai_max_retries,
logger.info("Initiating WhisperX client")
whisperx_client = openai.OpenAI(
api_key=settings.whisperx_api_key,
base_url=settings.whisperx_base_url,
max_retries=settings.whisperx_max_retries,
)
try:
logger.info("Querying transcription …")
transcription_start_time = time.time()
with open(temp_file_path, "rb") as audio_file:
transcription = openai_client.audio.transcriptions.create(
model=settings.openai_asr_model, file=audio_file
transcription = whisperx_client.audio.transcriptions.create(
model=settings.whisperx_asr_model, file=audio_file
)
metadata_manager.track(
task_id,

View File

@@ -32,10 +32,10 @@ class Settings(BaseSettings):
aws_s3_secure_access: bool = True
# AI-related settings
openai_api_key: str
openai_base_url: str = "https://api.openai.com/v1"
openai_asr_model: str = "whisper-1"
openai_max_retries: int = 0
whisperx_api_key: str
whisperx_base_url: str = "https://api.openai.com/v1"
whisperx_asr_model: str = "whisper-1"
whisperx_max_retries: int = 0
# Webhook-related settings
webhook_max_retries: int = 2