Rate this page:

VoiceAgentAPIEvents

Add the following line to your scenario code to use the events:

require(Modules.XAI);

Constants

ConnectorInformation
Copy URL

Contains information about connector.

Parameters

ConversationCreated
Copy URL

The first message at connection. Notifies the client that a conversation session has been created. https://docs.x.ai/developers/rest-api-reference/inference/voice#conversation.created

Parameters

ConversationItemAdded
Copy URL

Responding to the client that a new user message has been added to conversation history, or if an assistance response has been added to conversation history. https://docs.x.ai/developers/rest-api-reference/inference/voice#conversation.item.added

Parameters

ConversationItemDeleted
Copy URL

Parameters

ConversationItemInputAudioTranscriptionCompleted
Copy URL

Parameters

ConversationItemInputAudioTranscriptionUpdated
Copy URL

Parameters

ConversationItemTruncated
Copy URL

Parameters

Error
Copy URL

Sent when an error occurs. Contains error code and message. https://docs.x.ai/developers/rest-api-reference/inference/voice#error

Parameters

InputAudioBufferCleared
Copy URL

Parameters

InputAudioBufferCommitted
Copy URL

Parameters

InputAudioBufferSpeechStarted
Copy URL

Notify the client the server's VAD has detected the start of a speech. https://docs.x.ai/developers/rest-api-reference/inference/voice#input_audio_buffer.speech_started

Parameters

InputAudioBufferSpeechStopped
Copy URL

Notify the client the server's VAD has detected the end of a speech. https://docs.x.ai/developers/rest-api-reference/inference/voice#input_audio_buffer.speech_stopped

Parameters

InputAudioBufferTimeoutTriggered
Copy URL

Parameters

MCPListToolsCompleted
Copy URL

Parameters

MCPListToolsFailed
Copy URL

Parameters

MCPListToolsInProgress
Copy URL

Parameters

ResponseContentPartAdded
Copy URL

Parameters

ResponseContentPartDone
Copy URL

Parameters

ResponseCreated
Copy URL

A new assistant response turn is in progress. Audio delta created from this assistant turn will have the same response id. https://docs.x.ai/developers/rest-api-reference/inference/voice#response.created

Parameters

ResponseDone
Copy URL

Parameters

ResponseFunctionCallArgumentsDelta
Copy URL

Parameters

ResponseFunctionCallArgumentsDone
Copy URL

Parameters

ResponseMCPCallArgumentsDelta
Copy URL

Parameters

ResponseMCPCallArgumentsDone
Copy URL

Parameters

ResponseMCPCallCompleted
Copy URL

Parameters

ResponseMCPCallFailed
Copy URL

Parameters

ResponseMCPCallInProgress
Copy URL

Parameters

ResponseOutputAudioDone
Copy URL

Notifies client that the audio for this turn has finished generating. https://docs.x.ai/developers/rest-api-reference/inference/voice#response.output_audio.done

Parameters

ResponseOutputAudioTranscriptDelta
Copy URL

Parameters

ResponseOutputAudioTranscriptDone
Copy URL

The audio transcript delta of the assistant response has finished generating. https://docs.x.ai/developers/rest-api-reference/inference/voice#response.output_audio_transcript.done

Parameters

ResponseOutputItemAdded
Copy URL

Parameters

ResponseOutputItemDone
Copy URL

Parameters

ResponseOutputTextDelta
Copy URL

Parameters

ResponseOutputTextDone
Copy URL

The text of the assistant response has finished generating. https://docs.x.ai/developers/rest-api-reference/inference/voice#response.output_text.done

Parameters

SessionCreated
Copy URL

Parameters

SessionUpdated
Copy URL

Acknowledge the client's "session.update" message that the session has been updated. https://docs.x.ai/developers/rest-api-reference/inference/voice#session.updated

Parameters

Unknown
Copy URL

The unknown event.

Parameters

WebSocketError
Copy URL

The WebSocket error response event.

Parameters

Rate this page: