mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-25 10:44:24 +00:00
Merge pull request #3928 from BerriAI/litellm_audio_speech_endpoint
feat(main.py): support openai tts endpoint
This commit is contained in:
commit
d3a247bf20
11 changed files with 574 additions and 7 deletions
|
@ -1136,6 +1136,8 @@ class CallTypes(Enum):
|
|||
amoderation = "amoderation"
|
||||
atranscription = "atranscription"
|
||||
transcription = "transcription"
|
||||
aspeech = "aspeech"
|
||||
speech = "speech"
|
||||
|
||||
|
||||
# Logging function -> log the exact model details + what's being sent | Non-BlockingP
|
||||
|
@ -3005,6 +3007,10 @@ def function_setup(
|
|||
):
|
||||
_file_name: BinaryIO = args[1] if len(args) > 1 else kwargs["file"]
|
||||
messages = "audio_file"
|
||||
elif (
|
||||
call_type == CallTypes.aspeech.value or call_type == CallTypes.speech.value
|
||||
):
|
||||
messages = kwargs.get("input", "speech")
|
||||
stream = True if "stream" in kwargs and kwargs["stream"] == True else False
|
||||
logging_obj = Logging(
|
||||
model=model,
|
||||
|
@ -3346,6 +3352,8 @@ def client(original_function):
|
|||
return result
|
||||
elif "atranscription" in kwargs and kwargs["atranscription"] == True:
|
||||
return result
|
||||
elif "aspeech" in kwargs and kwargs["aspeech"] == True:
|
||||
return result
|
||||
|
||||
### POST-CALL RULES ###
|
||||
post_call_processing(original_response=result, model=model or None)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue