Class: OpenAI::Models::Realtime::InputAudioBufferAppendEvent

Inherits:
Internal::Type::BaseModel show all
Defined in:
lib/openai/models/realtime/input_audio_buffer_append_event.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Internal::Type::BaseModel

==, #==, #[], coerce, #deconstruct_keys, #deep_to_h, dump, fields, hash, #hash, inherited, inspect, #inspect, known_fields, optional, recursively_to_h, required, #to_h, #to_json, #to_s, to_sorbet_type, #to_yaml

Methods included from Internal::Type::Converter

#coerce, coerce, #dump, dump, inspect, #inspect, meta_info, new_coerce_state, type_info

Methods included from Internal::Util::SorbetRuntimeSupport

#const_missing, #define_sorbet_constant!, #sorbet_constant_defined?, #to_sorbet_type, to_sorbet_type

Constructor Details

#initialize(audio:, event_id: nil, type: :"input_audio_buffer.append") ⇒ Object

Some parameter documentations has been truncated, see OpenAI::Models::Realtime::InputAudioBufferAppendEvent for more details.

Send this event to append audio bytes to the input audio buffer. The audio buffer is temporary storage you can write to and later commit. A “commit” will create a new user message item in the conversation history from the buffer content and clear the buffer. Input audio transcription (if enabled) will be generated when the buffer is committed.

If VAD is enabled the audio buffer is used to detect speech and the server will decide when to commit. When Server VAD is disabled, you must commit the audio buffer manually. Input audio noise reduction operates on writes to the audio buffer.

The client may choose how much audio to place in each event up to a maximum of 15 MiB, for example streaming smaller chunks from the client may allow the VAD to be more responsive. Unlike most other client events, the server will not send a confirmation response to this event.

Parameters:

  • audio (String)

    Base64-encoded audio bytes. This must be in the format specified by the

  • event_id (String) (defaults to: nil)

    Optional client-generated ID used to identify this event.

  • type (Symbol, :"input_audio_buffer.append") (defaults to: :"input_audio_buffer.append")

    The event type, must be ‘input_audio_buffer.append`.



# File 'lib/openai/models/realtime/input_audio_buffer_append_event.rb', line 26

Instance Attribute Details

#audioString

Base64-encoded audio bytes. This must be in the format specified by the ‘input_audio_format` field in the session configuration.

Returns:

  • (String)


12
# File 'lib/openai/models/realtime/input_audio_buffer_append_event.rb', line 12

required :audio, String

#event_idString?

Optional client-generated ID used to identify this event.

Returns:

  • (String, nil)


24
# File 'lib/openai/models/realtime/input_audio_buffer_append_event.rb', line 24

optional :event_id, String

#typeSymbol, :"input_audio_buffer.append"

The event type, must be ‘input_audio_buffer.append`.

Returns:

  • (Symbol, :"input_audio_buffer.append")


18
# File 'lib/openai/models/realtime/input_audio_buffer_append_event.rb', line 18

required :type, const: :"input_audio_buffer.append"