VoiceAgentAPIEvents
Constants
ConnectorInformation
Contains information about connector.
Parameters
client:
The Grok.VoiceAgentAPIClient instance.
data:
Object
OptionalThe event's data.
ConversationCreated
The first message at connection. Notifies the client that a conversation session has been created. https://docs.x.ai/docs/guides/voice/agent#server-events-2
Parameters
client:
The Grok.VoiceAgentAPIClient instance.
data:
Object
OptionalThe event's data.
ConversationItemAdded
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/docs/guides/voice/agent#server
Parameters
client:
The Grok.VoiceAgentAPIClient instance.
data:
Object
OptionalThe event's data.
ConversationItemInputAudioTranscriptionCompleted
Notify the client the audio transcription for input has been completed. https://docs.x.ai/docs/guides/voice/agent#server
Parameters
client:
The Grok.VoiceAgentAPIClient instance.
data:
Object
OptionalThe event's data.
InputAudioBufferCleared
Input audio buffer has been cleared. https://docs.x.ai/docs/guides/voice/agent#server-1
Parameters
client:
The Grok.VoiceAgentAPIClient instance.
data:
Object
OptionalThe event's data.
InputAudioBufferCommitted
Input audio buffer has been committed. https://docs.x.ai/docs/guides/voice/agent#server-1
Parameters
client:
The Grok.VoiceAgentAPIClient instance.
data:
Object
OptionalThe event's data.
InputAudioBufferSpeechStarted
Notify the client the server's VAD has detected the start of a speech. https://docs.x.ai/docs/guides/voice/agent#server-1
Parameters
client:
The Grok.VoiceAgentAPIClient instance.
data:
Object
OptionalThe event's data.
InputAudioBufferSpeechStopped
Notify the client the server's VAD has detected the end of a speech. https://docs.x.ai/docs/guides/voice/agent#server-1
Parameters
client:
The Grok.VoiceAgentAPIClient instance.
data:
Object
OptionalThe event's data.
ResponseContentPartAdded
Notifies client that the content part added.
Parameters
client:
The Grok.VoiceAgentAPIClient instance.
data:
Object
OptionalThe event's data.
ResponseContentPartDone
Notifies client that the content part done.
Parameters
client:
The Grok.VoiceAgentAPIClient instance.
data:
Object
OptionalThe event's data.
ResponseCreated
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/docs/guides/voice/agent#server-2
Parameters
client:
The Grok.VoiceAgentAPIClient instance.
data:
Object
OptionalThe event's data.
ResponseDone
The assistant's response is completed. https://docs.x.ai/docs/guides/voice/agent#server-2
Parameters
client:
The Grok.VoiceAgentAPIClient instance.
data:
Object
OptionalThe event's data.
ResponseFunctionCallArgumentsDone
Function call triggered with complete arguments. https://docs.x.ai/docs/guides/voice/agent#handling-function-call-responses
Parameters
client:
The Grok.VoiceAgentAPIClient instance.
data:
Object
OptionalThe event's data.
ResponseOutputAudioDone
Notifies client that the audio for this turn has finished generating. https://docs.x.ai/docs/guides/voice/agent#server-3
Parameters
client:
The Grok.VoiceAgentAPIClient instance.
data:
Object
OptionalThe event's data.
ResponseOutputAudioTranscriptDelta
Audio transcript delta of the assistant response. https://docs.x.ai/docs/guides/voice/agent#server-3
Parameters
client:
The Grok.VoiceAgentAPIClient instance.
data:
Object
OptionalThe event's data.
ResponseOutputAudioTranscriptDone
The audio transcript delta of the assistant response has finished generating. https://docs.x.ai/docs/guides/voice/agent#server-3
Parameters
client:
The Grok.VoiceAgentAPIClient instance.
data:
Object
OptionalThe event's data.
ResponseOutputItemAdded
A new assistant response is added to message history. https://docs.x.ai/docs/guides/voice/agent#server-2
Parameters
client:
The Grok.VoiceAgentAPIClient instance.
data:
Object
OptionalThe event's data.
ResponseOutputItemDone
A new assistant response is done.
Parameters
client:
The Grok.VoiceAgentAPIClient instance.
data:
Object
OptionalThe event's data.
SessionUpdated
Acknowledge the client's "session.update" message that the session has been updated. https://docs.x.ai/docs/guides/voice/agent#server-events-1
Parameters
client:
The Grok.VoiceAgentAPIClient instance.
data:
Object
OptionalThe event's data.
Unknown
The unknown event.
Parameters
client:
The Grok.VoiceAgentAPIClient instance.
data:
Object
OptionalThe event's data.
WebSocketError
The WebSocket error response event.
Parameters
client:
The Grok.VoiceAgentAPIClient instance.
data:
Object
OptionalThe event's data.