feat - support health check audio_speech

This commit is contained in:
Ishaan Jaff 2024-07-25 17:26:14 -07:00
parent e3142b4294
commit 2432c90515
2 changed files with 14 additions and 1 deletions

View file

@ -1881,8 +1881,15 @@ class OpenAIChatCompletion(BaseLLM):
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:
raise Exception("mode not set")
raise ValueError("mode not set, passed in mode: " + mode)
response = {}
if completion is None or not hasattr(completion, "headers"):