fix handlers

This commit is contained in:
Ishaan Jaffer 2026-02-03 19:46:40 -08:00
parent 97d0ca447b
commit 48a60de91f
3 changed files with 22 additions and 6 deletions

View file

@ -32,7 +32,7 @@ async def run_voice_agent():
print(f" Proxy: {PROXY_URL}")
print()
async with websockets.connect(url, extra_headers=headers) as ws:
async with websockets.connect(url, additional_headers=headers) as ws:
# Receive initial connection event
initial = json.loads(await ws.recv())
print(f"✅ Connected! Event: {initial['type']}\n")

View file

@ -178,12 +178,28 @@ Because they make up everything!
```
## Complete Working Example (Cookbook)
## Complete Working Example
See the full working example in our [LiveKit Agent SDK Cookbook](https://github.com/BerriAI/litellm/tree/main/cookbook/livekit_agent_sdk).
**[LiveKit Agent SDK Cookbook](https://github.com/BerriAI/litellm/tree/main/cookbook/livekit_agent_sdk)**
Includes:
- ✅ Simple voice agent (`main.py`)
- ✅ Config example (`config.example.yaml`)
- ✅ How to run guide (`HOW_TO_RUN.md`)
### Quick Test
```bash
# 1. Start proxy
poetry run litellm --config cookbook/livekit_agent_sdk/config.example.yaml --port 4000
# 2. Run agent (in new terminal)
cd cookbook/livekit_agent_sdk
poetry run python main.py
```
## Learn More
- [xAI Realtime API Documentation](/docs/providers/xai_realtime)
- [LiveKit xAI Plugin Docs](https://docs.livekit.io/agents/models/realtime/plugins/xai/)
- [xAI Realtime API](/docs/providers/xai_realtime)
- [LiveKit xAI Plugin](https://docs.livekit.io/agents/models/realtime/plugins/xai/)
- [LiteLLM Realtime API](/docs/realtime)

View file

@ -131,7 +131,7 @@ class OpenAIRealtime(OpenAIChatCompletion):
)
async with websockets.connect( # type: ignore
url,
extra_headers=headers, # type: ignore
additional_headers=headers, # type: ignore
max_size=REALTIME_WEBSOCKET_MAX_MESSAGE_SIZE_BYTES,
ssl=ssl_config,
) as backend_ws: