LiveAPIEvents
Add the following line to your scenario code to use the events:
require(Modules.OpenAI);
Constants
Emitted when the agent started speaking. Derived by AI Connector from output audio. Marks when audio enters the media path, before the caller hears it.
Parameters
client:
The Gemini.LiveAPIClient instance.
data:
{customEvent: string, payload: Object}
OptionalThe 'payload' parameter contains the event's data.
Emitted when the agent stopped speaking. Derived by AI Connector from output audio. Marks when audio stops entering the media path, before the caller hears the speech end.
Parameters
client:
The Gemini.LiveAPIClient instance.
data:
{customEvent: string, payload: Object}
OptionalThe 'payload' parameter contains the event's data.
Contains information about connector.
Parameters
client:
The Gemini.LiveAPIClient instance.
data:
{customEvent: string, payload: Object}
OptionalThe 'payload' parameter contains the event's data.
Reports an error in the Live session, such as an invalid client command. Use error.client_event_id, when present, to identify the command that caused the error. https://developers.openai.com/api/reference/resources/live/primary-websocket#error
Parameters
client:
The Gemini.LiveAPIClient instance.
data:
{customEvent: string, payload: Object}
OptionalThe 'payload' parameter contains the event's data.
The HTTP response event.
Parameters
client:
The Gemini.LiveAPIClient instance.
data:
{customEvent: string, payload: Object}
OptionalThe 'payload' parameter contains the event's data.
A streaming Responses API event from a backend delegated to by the Live session. Unwrap data.payload.event and preserve the outer delegation_id. https://developers.openai.com/api/reference/resources/live/primary-websocket#response.event
Parameters
client:
The Gemini.LiveAPIClient instance.
data:
{customEvent: string, payload: Object}
OptionalThe 'payload' parameter contains the event's data.
Returned after the Live session finishes finalizing, with the close reason, final session snapshot, and cumulative audio usage. A connection that closes without this event does not confirm successful finalization. https://developers.openai.com/api/reference/resources/live/primary-websocket#session.closed
Parameters
client:
The Gemini.LiveAPIClient instance.
data:
{customEvent: string, payload: Object}
OptionalThe 'payload' parameter contains the event's data.
Returned when a OpenAI.LiveAPIClient.sessionCommentaryAppend command is accepted into the Live session timeline. Match the command through client_event_id. This acknowledges the commentary and does not guarantee exact wording or completed audio playback. https://developers.openai.com/api/reference/resources/live/primary-websocket#session.commentary.appended
Parameters
client:
The Gemini.LiveAPIClient instance.
data:
{customEvent: string, payload: Object}
OptionalThe 'payload' parameter contains the event's data.
Returned when the Live model delegates work to your application or a Responses backend. The payload carries delegation metadata and timeline position, not the task text or tool arguments. https://developers.openai.com/api/reference/resources/live/primary-websocket#session.delegation.created
Parameters
client:
The Gemini.LiveAPIClient instance.
data:
{customEvent: string, payload: Object}
OptionalThe 'payload' parameter contains the event's data.
Returned when a OpenAI.LiveAPIClient.sessionInputAudioMute command is accepted. Input audio is no longer sent to the model. https://developers.openai.com/api/reference/resources/live/primary-websocket#session.input_audio.muted
Parameters
client:
The Gemini.LiveAPIClient instance.
data:
{customEvent: string, payload: Object}
OptionalThe 'payload' parameter contains the event's data.
Returned when a OpenAI.LiveAPIClient.sessionInputAudioUnmute command is accepted. Input audio is sent to the model again. https://developers.openai.com/api/reference/resources/live/primary-websocket#session.input_audio.unmuted
Parameters
client:
The Gemini.LiveAPIClient instance.
data:
{customEvent: string, payload: Object}
OptionalThe 'payload' parameter contains the event's data.
A transcript fragment for user input audio. Append each fragment in delivery order. These events do not define complete turns and have no transcript-done event. https://developers.openai.com/api/reference/resources/live/primary-websocket#session.input_transcript.delta
Parameters
client:
The Gemini.LiveAPIClient instance.
data:
{customEvent: string, payload: Object}
OptionalThe 'payload' parameter contains the event's data.
Returned when a OpenAI.LiveAPIClient.sessionInstructionsAppend command is accepted into the Live session timeline. Match the command through client_event_id. This acknowledges the instructions and does not guarantee that the model has acted on them. https://developers.openai.com/api/reference/resources/live/primary-websocket#session.instructions.appended
Parameters
client:
The Gemini.LiveAPIClient instance.
data:
{customEvent: string, payload: Object}
OptionalThe 'payload' parameter contains the event's data.
A transcript fragment for assistant output audio. Append each fragment in delivery order. These events do not define complete turns and have no transcript-done event. https://developers.openai.com/api/reference/resources/live/primary-websocket#session.output_transcript.delta
Parameters
client:
The Gemini.LiveAPIClient instance.
data:
{customEvent: string, payload: Object}
OptionalThe 'payload' parameter contains the event's data.
Returned when a Live session has started. Contains the resolved session configuration, including server defaults. https://developers.openai.com/api/reference/resources/live/primary-websocket#session.started
Parameters
client:
The Gemini.LiveAPIClient instance.
data:
{customEvent: string, payload: Object}
OptionalThe 'payload' parameter contains the event's data.
Returned when a OpenAI.LiveAPIClient.sessionThinkingAppend command is accepted into the Live session timeline. Match the command through client_event_id. This acknowledges the reasoning context and does not guarantee spoken output. https://developers.openai.com/api/reference/resources/live/primary-websocket#session.thinking.appended
Parameters
client:
The Gemini.LiveAPIClient instance.
data:
{customEvent: string, payload: Object}
OptionalThe 'payload' parameter contains the event's data.
Returned when a Live session update is accepted. Contains the resolved session configuration after the update. https://developers.openai.com/api/reference/resources/live/primary-websocket#session.updated
Parameters
client:
The Gemini.LiveAPIClient instance.
data:
{customEvent: string, payload: Object}
OptionalThe 'payload' parameter contains the event's data.
Reports cumulative Live audio usage and, when available, the most recent context-window usage. Do not sum usage.seconds across events. Delegated Responses token usage is reported separately in OpenAI.LiveAPIEvents.ResponseEvent. https://developers.openai.com/api/reference/resources/live/primary-websocket#session.usage.updated
Parameters
client:
The Gemini.LiveAPIClient instance.
data:
{customEvent: string, payload: Object}
OptionalThe 'payload' parameter contains the event's data.
The unknown event.
Parameters
client:
The Gemini.LiveAPIClient instance.
data:
{customEvent: string, payload: Object}
OptionalThe 'payload' parameter contains the event's data.
The WebSocket error response event.
Parameters
client:
The Gemini.LiveAPIClient instance.
data:
{customEvent: string, payload: Object}
OptionalThe 'payload' parameter contains the event's data.