on Agent Metrics
Called after each conversational turn with the agent's own timings, model choices and the text of the turn. Register it on an AgentParticipant, like onAgentTranscriptionReceived.
The payload is the server's, forwarded as-is, so read defensively:
latency | milliseconds: e2eLatency, ttfb, ttft, sttLatency, eouLatency |
providers | llmProviderClass/llmModelName, and the same pair for stt and tts |
speech | user.text (what the agent heard) and agent.text (what it replied) |
systemInstructions | the prompt the agent is running under |