🔧(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:
committed by
aleb_the_flash
parent
0102b428f1
commit
bfdf5548a0
@@ -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,
|
||||
}
|
||||
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user