VoiceAgentAPIEvents
Add the following line to your scenario code to use the events:
require(Modules.XAI);
Constants
Contains information about connector.
Parameters
client:
The QwenCloud.VoiceAgentAPIClient instance.
data:
{customEvent: string, payload: Object}
OptionalThe event payload from the connector.
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
client:
The QwenCloud.VoiceAgentAPIClient instance.
data:
{customEvent: string, payload: Object}
OptionalThe event payload from the connector.
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
client:
The QwenCloud.VoiceAgentAPIClient instance.
data:
{customEvent: string, payload: Object}
OptionalThe event payload from the connector.
Returned when an item in the conversation is deleted. https://docs.x.ai/developers/rest-api-reference/inference/voice#conversation.item.deleted
Parameters
client:
The QwenCloud.VoiceAgentAPIClient instance.
data:
{customEvent: string, payload: Object}
OptionalThe event payload from the connector.
Notify the client the audio transcription for input has been completed. https://docs.x.ai/developers/rest-api-reference/inference/voice#conversation.item.input_audio_transcription.completed
Parameters
client:
The QwenCloud.VoiceAgentAPIClient instance.
data:
{customEvent: string, payload: Object}
OptionalThe event payload from the connector.
Returned when input audio transcription is updated. https://docs.x.ai/developers/rest-api-reference/inference/voice#conversation.item.input_audio_transcription.updated
Parameters
client:
The QwenCloud.VoiceAgentAPIClient instance.
data:
{customEvent: string, payload: Object}
OptionalThe event payload from the connector.
Returned when a conversation item is truncated. https://docs.x.ai/developers/rest-api-reference/inference/voice#conversation.item.truncated
Parameters
client:
The QwenCloud.VoiceAgentAPIClient instance.
data:
{customEvent: string, payload: Object}
OptionalThe event payload from the connector.
Sent when an error occurs. Contains error code and message. https://docs.x.ai/developers/rest-api-reference/inference/voice#error
Parameters
client:
The QwenCloud.VoiceAgentAPIClient instance.
data:
{customEvent: string, payload: Object}
OptionalThe event payload from the connector.
Input audio buffer has been cleared. https://docs.x.ai/developers/rest-api-reference/inference/voice#input_audio_buffer.cleared
Parameters
client:
The QwenCloud.VoiceAgentAPIClient instance.
data:
{customEvent: string, payload: Object}
OptionalThe event payload from the connector.
Input audio buffer has been committed. https://docs.x.ai/developers/rest-api-reference/inference/voice#input_audio_buffer.committed
Parameters
client:
The QwenCloud.VoiceAgentAPIClient instance.
data:
{customEvent: string, payload: Object}
OptionalThe event payload from the connector.
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
client:
The QwenCloud.VoiceAgentAPIClient instance.
data:
{customEvent: string, payload: Object}
OptionalThe event payload from the connector.
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
client:
The QwenCloud.VoiceAgentAPIClient instance.
data:
{customEvent: string, payload: Object}
OptionalThe event payload from the connector.
Returned when the input audio buffer idle timeout is triggered. https://docs.x.ai/developers/rest-api-reference/inference/voice#input_audio_buffer.timeout_triggered
Parameters
client:
The QwenCloud.VoiceAgentAPIClient instance.
data:
{customEvent: string, payload: Object}
OptionalThe event payload from the connector.
MCP list tools completed. https://docs.x.ai/developers/rest-api-reference/inference/voice#response.mcp_list_tools.completed
Parameters
client:
The QwenCloud.VoiceAgentAPIClient instance.
data:
{customEvent: string, payload: Object}
OptionalThe event payload from the connector.
MCP list tools failed. https://docs.x.ai/developers/rest-api-reference/inference/voice#response.mcp_list_tools.failed
Parameters
client:
The QwenCloud.VoiceAgentAPIClient instance.
data:
{customEvent: string, payload: Object}
OptionalThe event payload from the connector.
MCP list tools is in progress. https://docs.x.ai/developers/rest-api-reference/inference/voice#response.mcp_list_tools.in_progress
Parameters
client:
The QwenCloud.VoiceAgentAPIClient instance.
data:
{customEvent: string, payload: Object}
OptionalThe event payload from the connector.
Notifies client that the content part added. https://docs.x.ai/developers/rest-api-reference/inference/voice#response.content_part.added
Parameters
client:
The QwenCloud.VoiceAgentAPIClient instance.
data:
{customEvent: string, payload: Object}
OptionalThe event payload from the connector.
Notifies client that the content part done. https://docs.x.ai/developers/rest-api-reference/inference/voice#response.content_part.done
Parameters
client:
The QwenCloud.VoiceAgentAPIClient instance.
data:
{customEvent: string, payload: Object}
OptionalThe event payload from the connector.
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
client:
The QwenCloud.VoiceAgentAPIClient instance.
data:
{customEvent: string, payload: Object}
OptionalThe event payload from the connector.
The assistant's response is completed. https://docs.x.ai/developers/rest-api-reference/inference/voice#response.done
Parameters
client:
The QwenCloud.VoiceAgentAPIClient instance.
data:
{customEvent: string, payload: Object}
OptionalThe event payload from the connector.
Function call arguments delta. https://docs.x.ai/developers/rest-api-reference/inference/voice#response.function_call_arguments.delta
Parameters
client:
The QwenCloud.VoiceAgentAPIClient instance.
data:
{customEvent: string, payload: Object}
OptionalThe event payload from the connector.
Function call triggered with complete arguments. https://docs.x.ai/developers/rest-api-reference/inference/voice#response.function_call_arguments.done
Parameters
client:
The QwenCloud.VoiceAgentAPIClient instance.
data:
{customEvent: string, payload: Object}
OptionalThe event payload from the connector.
MCP call arguments delta. https://docs.x.ai/developers/rest-api-reference/inference/voice#response.mcp_call_arguments.delta
Parameters
client:
The QwenCloud.VoiceAgentAPIClient instance.
data:
{customEvent: string, payload: Object}
OptionalThe event payload from the connector.
MCP call arguments completed. https://docs.x.ai/developers/rest-api-reference/inference/voice#response.mcp_call_arguments.done
Parameters
client:
The QwenCloud.VoiceAgentAPIClient instance.
data:
{customEvent: string, payload: Object}
OptionalThe event payload from the connector.
MCP call completed. https://docs.x.ai/developers/rest-api-reference/inference/voice#response.mcp_call.completed
Parameters
client:
The QwenCloud.VoiceAgentAPIClient instance.
data:
{customEvent: string, payload: Object}
OptionalThe event payload from the connector.
MCP call failed. https://docs.x.ai/developers/rest-api-reference/inference/voice#response.mcp_call.failed
Parameters
client:
The QwenCloud.VoiceAgentAPIClient instance.
data:
{customEvent: string, payload: Object}
OptionalThe event payload from the connector.
MCP call is in progress. https://docs.x.ai/developers/rest-api-reference/inference/voice#response.mcp_call.in_progress
Parameters
client:
The QwenCloud.VoiceAgentAPIClient instance.
data:
{customEvent: string, payload: Object}
OptionalThe event payload from the connector.
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
client:
The QwenCloud.VoiceAgentAPIClient instance.
data:
{customEvent: string, payload: Object}
OptionalThe event payload from the connector.
Audio transcript delta of the assistant response. https://docs.x.ai/developers/rest-api-reference/inference/voice#response.output_audio_transcript.delta
Parameters
client:
The QwenCloud.VoiceAgentAPIClient instance.
data:
{customEvent: string, payload: Object}
OptionalThe event payload from the connector.
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
client:
The QwenCloud.VoiceAgentAPIClient instance.
data:
{customEvent: string, payload: Object}
OptionalThe event payload from the connector.
A new assistant response is added to message history. https://docs.x.ai/developers/rest-api-reference/inference/voice#response.output_item.added
Parameters
client:
The QwenCloud.VoiceAgentAPIClient instance.
data:
{customEvent: string, payload: Object}
OptionalThe event payload from the connector.
A new assistant response is done. https://docs.x.ai/developers/rest-api-reference/inference/voice#response.output_item.done
Parameters
client:
The QwenCloud.VoiceAgentAPIClient instance.
data:
{customEvent: string, payload: Object}
OptionalThe event payload from the connector.
Text delta of the assistant response. https://docs.x.ai/developers/rest-api-reference/inference/voice#response.output_text.delta
Parameters
client:
The QwenCloud.VoiceAgentAPIClient instance.
data:
{customEvent: string, payload: Object}
OptionalThe event payload from the connector.
The text of the assistant response has finished generating. https://docs.x.ai/developers/rest-api-reference/inference/voice#response.output_text.done
Parameters
client:
The QwenCloud.VoiceAgentAPIClient instance.
data:
{customEvent: string, payload: Object}
OptionalThe event payload from the connector.
Returned when a session is created. https://docs.x.ai/developers/rest-api-reference/inference/voice#session.created
Parameters
client:
The QwenCloud.VoiceAgentAPIClient instance.
data:
{customEvent: string, payload: Object}
OptionalThe event payload from the connector.
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
client:
The QwenCloud.VoiceAgentAPIClient instance.
data:
{customEvent: string, payload: Object}
OptionalThe event payload from the connector.
The unknown event.
Parameters
client:
The QwenCloud.VoiceAgentAPIClient instance.
data:
{customEvent: string, payload: Object}
OptionalThe event payload from the connector.
The WebSocket error response event.
Parameters
client:
The QwenCloud.VoiceAgentAPIClient instance.
data:
{customEvent: string, payload: Object}
OptionalThe event payload from the connector.