Feature Type
Would make my life easier
Feature Description
Problem
I'm using livekit-plugins-xai with xai.realtime.RealtimeModel.
I can see calls/responses in the xAI console, but I need to correlate those provider-side logs with my app's call/session ids.
Currently, the only provider id I can find is RealtimeModelMetrics.request_id, which appears to map to the xAI/OpenAI realtime response.id. However, the AgentSession metrics_collected event is marked deprecated:
Use session_usage_updated for usage tracking and ChatMessage.metrics for per-turn latency.
Neither session_usage_updated nor ChatMessage.metrics appears to expose the provider response id or any provider session/conversation id.
Request
Please expose xAI realtime provider correlation ids through a non-deprecated API.
Useful fields would be:
- provider response id, e.g.
response.id
- provider session/conversation id, if xAI returns one
- possibly provider event id / client event id mapping
Possible places:
ChatMessage.metrics["llm_response_id"]
- a field on assistant
ChatMessage.extra
- a non-deprecated
AgentSession event for provider request/response metadata
session_usage_updated including request ids, if that fits the API design
Workarounds / Alternatives
Current workaround
Listen to deprecated metrics_collected and inspect:
from livekit.agents.metrics import RealtimeModelMetrics
@session.on("metrics_collected")
def on_metrics_collected(event):
metrics = event.metrics
if isinstance(metrics, RealtimeModelMetrics):
print(metrics.request_id)
### Additional Context
- `livekit-agents`: 1.6.4+
- `livekit-plugins-xai`: 1.6.4+
- model: `grok-voice-think-fast-1.0
Feature Type
Would make my life easier
Feature Description
Problem
I'm using
livekit-plugins-xaiwithxai.realtime.RealtimeModel.I can see calls/responses in the xAI console, but I need to correlate those provider-side logs with my app's call/session ids.
Currently, the only provider id I can find is
RealtimeModelMetrics.request_id, which appears to map to the xAI/OpenAI realtimeresponse.id. However, theAgentSessionmetrics_collectedevent is marked deprecated:Neither
session_usage_updatednorChatMessage.metricsappears to expose the provider response id or any provider session/conversation id.Request
Please expose xAI realtime provider correlation ids through a non-deprecated API.
Useful fields would be:
response.idPossible places:
ChatMessage.metrics["llm_response_id"]ChatMessage.extraAgentSessionevent for provider request/response metadatasession_usage_updatedincluding request ids, if that fits the API designWorkarounds / Alternatives
Current workaround
Listen to deprecated
metrics_collectedand inspect: