Skip to content

The fastest, litest AI Gateway. Rust core with Python SDK. Call 100+ LLM APIs in OpenAI (or native) format with cost tracking, guardrails, load balancing, and logging [Bedrock, Azure, OpenAI, Anthropic, OpenAI, VertexAI, vLLM, Nvidia NIM]

test(realtime): expect session.created as xAI realtime initial event (#28424)

yuneng-jiange23d06dda4f4
diff --git a/tests/llm_translation/realtime/base_realtime_tests.py b/tests/llm_translation/realtime/base_realtime_tests.py
index 1d55f13b00d..f1c42659007 100644
--- a/tests/llm_translation/realtime/base_realtime_tests.py
+++ b/tests/llm_translation/realtime/base_realtime_tests.py
@@ -79,7 +79,7 @@ class RealTimeWebSocketClient:
def _is_initial_event(self, msg_type: str) -> bool:
"""Check if message type is an initial connection event"""
- # OpenAI sends "session.created", xAI sends "conversation.created"
+ # OpenAI and xAI send "session.created"; some providers send "conversation.created"
return msg_type in ["session.created", "conversation.created"]
async def receive_text(self):
diff --git a/tests/llm_translation/realtime/test_xai_realtime.py b/tests/llm_translation/realtime/test_xai_realtime.py
index 0bb7a59bb1a..86d0ebe3a3c 100644
--- a/tests/llm_translation/realtime/test_xai_realtime.py
+++ b/tests/llm_translation/realtime/test_xai_realtime.py
@@ -19,8 +19,8 @@ class TestXAIRealtime(BaseRealtimeTest):
"""
E2E tests for xAI Realtime API.
- xAI's Grok Voice Agent API is OpenAI-compatible but uses:
- - Different initial event: "conversation.created" instead of "session.created"
+ xAI's Grok Voice Agent API is OpenAI-compatible:
+ - Initial event: "session.created" (matches OpenAI)
- Different endpoint: wss://api.x.ai/v1/realtime
- Model: grok-4-1-fast-non-reasoning
"""
@@ -32,4 +32,4 @@ class TestXAIRealtime(BaseRealtimeTest):
return "XAI_API_KEY"
def get_initial_event_type(self) -> str:
- return "conversation.created"
+ return "session.created"