Class InputAudioBufferSpeechStartedEvent
-
- All Implemented Interfaces:
public final class InputAudioBufferSpeechStartedEvent
Sent by the server when in
server_vad
mode to indicate that speech has been detected in the audio buffer. This can happen any time audio is added to the buffer (unless speech is already detected). The client may want to use this event to interrupt audio playback or provide visual feedback to the user.The client should expect to receive a
input_audio_buffer.speech_stopped
event when speech stops. Theitem_id
property is the ID of the user message item that will be created when speech stops and will also be included in theinput_audio_buffer.speech_stopped
event (unless the client manually commits the audio buffer during VAD activation).
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public final class
InputAudioBufferSpeechStartedEvent.Builder
A builder for InputAudioBufferSpeechStartedEvent.
-
Method Summary
Modifier and Type Method Description final Long
audioStartMs()
Milliseconds from the start of all audio written to the buffer during the session when speech was first detected. final String
eventId()
The unique ID of the server event. final String
itemId()
The ID of the user message item that will be created when speech stops. final JsonValue
_type()
The event type, must be input_audio_buffer.speech_started
.final JsonField<Long>
_audioStartMs()
Returns the raw JSON value of audioStartMs. final JsonField<String>
_eventId()
Returns the raw JSON value of eventId. final JsonField<String>
_itemId()
Returns the raw JSON value of itemId. final Map<String, JsonValue>
_additionalProperties()
final InputAudioBufferSpeechStartedEvent.Builder
toBuilder()
final InputAudioBufferSpeechStartedEvent
validate()
final Boolean
isValid()
Boolean
equals(Object other)
Integer
hashCode()
String
toString()
final static InputAudioBufferSpeechStartedEvent.Builder
builder()
Returns a mutable builder for constructing an instance of InputAudioBufferSpeechStartedEvent. -
-
Method Detail
-
audioStartMs
final Long audioStartMs()
Milliseconds from the start of all audio written to the buffer during the session when speech was first detected. This will correspond to the beginning of audio sent to the model, and thus includes the
prefix_padding_ms
configured in the Session.
-
itemId
final String itemId()
The ID of the user message item that will be created when speech stops.
-
_type
final JsonValue _type()
The event type, must be
input_audio_buffer.speech_started
.Expected to always return the following:
JsonValue.from("input_audio_buffer.speech_started")
However, this method can be useful for debugging and logging (e.g. if the server responded with an unexpected value).
-
_audioStartMs
final JsonField<Long> _audioStartMs()
Returns the raw JSON value of audioStartMs.
Unlike audioStartMs, this method doesn't throw if the JSON field has an unexpected type.
-
_eventId
final JsonField<String> _eventId()
Returns the raw JSON value of eventId.
Unlike eventId, this method doesn't throw if the JSON field has an unexpected type.
-
_itemId
final JsonField<String> _itemId()
Returns the raw JSON value of itemId.
Unlike itemId, this method doesn't throw if the JSON field has an unexpected type.
-
_additionalProperties
final Map<String, JsonValue> _additionalProperties()
-
toBuilder
final InputAudioBufferSpeechStartedEvent.Builder toBuilder()
-
validate
final InputAudioBufferSpeechStartedEvent validate()
-
builder
final static InputAudioBufferSpeechStartedEvent.Builder builder()
Returns a mutable builder for constructing an instance of InputAudioBufferSpeechStartedEvent.
The following fields are required:
.audioStartMs() .eventId() .itemId()
-
-
-
-