fix(model_param_helper.py): update _get_litellm_supported_transcription_kwargs() to use proper annotations from TranscriptionCreateParamsNonStreaming & `TranscriptionCreateParamsStreaming

This commit is contained in:
Hammad Saeed 2025-03-21 16:55:35 -07:00
parent 3b9dd9be36
commit 732ab55cc8

View file

@ -1,6 +1,9 @@
from typing import Set
from openai.types.audio.transcription_create_params import TranscriptionCreateParams
from openai.types.audio.transcription_create_params import (
TranscriptionCreateParamsNonStreaming,
TranscriptionCreateParamsStreaming,
)
from openai.types.chat.completion_create_params import (
CompletionCreateParamsNonStreaming,
CompletionCreateParamsStreaming,
@ -123,7 +126,10 @@ class ModelParamHelper:
This follows the OpenAI API Spec
"""
return set(TranscriptionCreateParams.__dict__.keys())
all_transcription_kwargs = set(
TranscriptionCreateParamsNonStreaming.__annotations__.keys()
).union(set(TranscriptionCreateParamsStreaming.__annotations__.keys()))
return all_transcription_kwargs
@staticmethod
def _get_exclude_kwargs() -> Set[str]: