mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-27 11:43:54 +00:00
feat support audio health checks for azure
This commit is contained in:
parent
3573b47098
commit
f2443996d8
1 changed files with 17 additions and 0 deletions
|
@ -1864,6 +1864,23 @@ class AzureChatCompletion(BaseLLM):
|
||||||
model=model, # type: ignore
|
model=model, # type: ignore
|
||||||
prompt=prompt, # type: ignore
|
prompt=prompt, # type: ignore
|
||||||
)
|
)
|
||||||
|
elif mode == "audio_transcription":
|
||||||
|
# Get the current directory of the file being run
|
||||||
|
pwd = os.path.dirname(os.path.realpath(__file__))
|
||||||
|
file_path = os.path.join(pwd, "../tests/gettysburg.wav")
|
||||||
|
audio_file = open(file_path, "rb")
|
||||||
|
completion = await client.audio.transcriptions.with_raw_response.create(
|
||||||
|
file=audio_file,
|
||||||
|
model=model, # type: ignore
|
||||||
|
prompt=prompt, # type: ignore
|
||||||
|
)
|
||||||
|
elif mode == "audio_speech":
|
||||||
|
# Get the current directory of the file being run
|
||||||
|
completion = await client.audio.speech.with_raw_response.create(
|
||||||
|
model=model, # type: ignore
|
||||||
|
input=prompt, # type: ignore
|
||||||
|
voice="alloy",
|
||||||
|
)
|
||||||
else:
|
else:
|
||||||
raise Exception("mode not set")
|
raise Exception("mode not set")
|
||||||
response = {}
|
response = {}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue