mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-26 19:24:27 +00:00
(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:
parent
6eabc7268a
commit
4825e3eee5
6 changed files with 110 additions and 1 deletions
|
@ -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 = {}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue