mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-25 18:54:30 +00:00
* refactor: introduce new transformation config for gpt-4o-transcribe models * refactor: expose new transformation configs for audio transcription * ci: fix config yml * feat(openai/transcriptions): support provider config transformation on openai audio transcriptions allows gpt-4o and whisper audio transformation to work as expected * refactor: migrate fireworks ai + deepgram to new transform request pattern * feat(openai/): working support for gpt-4o-audio-transcribe * build(model_prices_and_context_window.json): add gpt-4o-transcribe to model cost map * build(model_prices_and_context_window.json): specify what endpoints are supported for `/audio/transcriptions` * fix(get_supported_openai_params.py): fix return * refactor(deepgram/): migrate unit test to deepgram handler * refactor: cleanup unused imports * fix(get_supported_openai_params.py): fix linting error * test: update test
34 lines
1,005 B
Python
34 lines
1,005 B
Python
from typing import List
|
|
|
|
from litellm.types.llms.openai import OpenAIAudioTranscriptionOptionalParams
|
|
from litellm.types.utils import FileTypes
|
|
|
|
from .whisper_transformation import OpenAIWhisperAudioTranscriptionConfig
|
|
|
|
|
|
class OpenAIGPTAudioTranscriptionConfig(OpenAIWhisperAudioTranscriptionConfig):
|
|
def get_supported_openai_params(
|
|
self, model: str
|
|
) -> List[OpenAIAudioTranscriptionOptionalParams]:
|
|
"""
|
|
Get the supported OpenAI params for the `gpt-4o-transcribe` models
|
|
"""
|
|
return [
|
|
"language",
|
|
"prompt",
|
|
"response_format",
|
|
"temperature",
|
|
"include",
|
|
]
|
|
|
|
def transform_audio_transcription_request(
|
|
self,
|
|
model: str,
|
|
audio_file: FileTypes,
|
|
optional_params: dict,
|
|
litellm_params: dict,
|
|
) -> dict:
|
|
"""
|
|
Transform the audio transcription request
|
|
"""
|
|
return {"model": model, "file": audio_file, **optional_params}
|