(Bug Fix) Add health check support for realtime models (#7453)

* add mode: realtime

* add _realtime_health_check

* test_realtime_health_check

* azure _realtime_health_check

* _realtime_health_check

* Realtime Models

* fix code quality
This commit is contained in:
Ishaan Jaff 2024-12-28 18:15:00 -08:00 committed by GitHub
parent 6eabc7268a
commit 4825e3eee5
6 changed files with 110 additions and 1 deletions

View file

@ -1374,6 +1374,17 @@ class OpenAIChatCompletion(BaseLLM):
input=prompt, # type: ignore
voice="alloy",
)
elif mode == "realtime":
from litellm.realtime_api.main import _realtime_health_check
# create a websocket connection
await _realtime_health_check(
model=model or "",
api_key=api_key,
api_base=api_base or "https://api.openai.com/",
custom_llm_provider="openai",
)
return {}
else:
raise ValueError("mode not set, passed in mode: " + mode)
response = {}