跳到导航

Agent WebSockets

Establish a WebSocket connection for real-time conversations with an AI agent.

握手

WSS
/v1/convai/conversation

查询参数

agent_idstring必需
The unique identifier of the agent to converse with.

发送

User Audio Chunkobject必需
Send audio data chunks from the user to the server for processing.
OR
Feedbackobject必需
Feedback score for a specific agent response event.
OR
User Messageobject必需
Text message sent by the user to the conversation.
OR
User Activityobject必需
Activity ping to prevent agent interruption and indicate user presence.
OR
Multimodal Messageobject必需
A message combining text and file references, sent by the user to the conversation.
OR
Pongobject必需
Response message to server ping requests for latency measurement.
OR
Client Tool Resultobject必需

Results from client-side tool execution requested by the server.

OR
Mcp Tool Approval Resultobject必需
User approval or rejection of an MCP tool call that requires confirmation.
OR
Contextual Updateobject必需

Non-interrupting content sent to update the conversation state without disrupting the flow.

OR
Conversation Initiation Client Dataobject必需
Client configuration data to override default conversation settings.

接收

Conversation Initiation Metadataobject必需
Initial metadata and configuration details for a new conversation, only sent once.
OR
Agent Response Completeobject必需
Notification that the agent has finished generating a complete response.
OR
Context Usageobject必需

Current LLM context-window usage, emitted after each completed agent turn. Reports the prompt size of the turn’s final LLM generation together with the model’s context limit.

OR
Mcp Tool Callobject必需

MCP tool call event with state updates (loading, awaiting_approval, success, failure).

OR
Client Errorobject必需
Error event sent when an error occurs during the conversation.
OR
Guardrail Triggeredobject必需
Notification that a guardrail was triggered during the conversation.
OR
User Transcriptobject必需

Real-time transcriptions of user speech input.

OR
Agent Responseobject必需
Text responses generated by the AI agent.
OR
Queue Statusobject必需

Wait-queue status for a caller held at the concurrency limit: waiting, admitted, or timed_out.

OR
Agent Response Correctionobject必需
Correction to a previous agent response.
OR
Agent Response Metadataobject必需
Metadata associated with an agent response, such as custom LLM response metadata.
OR
Audio Responseobject必需
Synthesized audio chunks of the agent's speech response.
OR
Interruptionobject必需
Notification that the agent's current response was interrupted.
OR
VAD Scoreobject必需
Voice Activity Detection scoring information.
OR
Agent Chat Response Partobject必需
Streaming text chunks of an agent's chat response.
OR
Client Tool Callobject必需
Requests from server for client to execute specific tool functions.
OR
Agent Tool Responseobject必需
Response from an agent tool execution including status and metadata.
OR
Agent Tool Response Full Payloadobject必需
Tool response including the tool's full result payload as a string.
OR
Agent Tool Requestobject必需
Notification that the agent is requesting a tool to be executed.
OR
Pingobject必需

Server-initiated ping messages for measuring connection latency.

OR
Mcp Connection Statusobject必需
MCP connection status update with integration connection states.