Client events
Understand and handle real-time events received by the client during conversational applications.
Understand and handle real-time events received by the client during conversational applications.
Client events are system-level events sent from the server to the client that facilitate real-time communication. These events deliver audio, transcription, agent responses, and other critical information to the client application.
For information on events you can send from the client to the server, see the Client-to-server events documentation.
Client events are essential for maintaining the real-time nature of conversations. They provide everything from initialization metadata to processed audio and agent responses.
These events are part of the WebSocket communication protocol and are automatically handled by our SDKs. Understanding them is crucial for advanced implementations and debugging.
Over WebRTC connections, the audio event is not sent as audio is handled directly by LiveKit.
client_events configurationThis event is specific to custom LLM integrations. It allows your custom LLM server to pass additional metadata alongside the response that can be consumed by the client application.
If you are using the SDK, callbacks are provided to handle sending the result back to the server.
agent_tool_response and additionally streams the tool’s full result payload as a string in full_tool_result.client_events configuration.This event exposes the complete tool result to the client and may contain sensitive data. Only enable it when the client is trusted to handle the payload. Results larger than 64 KB are automatically truncated.
loading, awaiting_approval, success and failure.client_events configurationtype field.client_events configuration.Here’s a typical sequence of events during a conversation:
Error handling
Audio management
Connection management
For detailed implementation examples, check our SDK documentation.