class

OpenAI::RealtimeSessionCreateResponse

Inherits JSON::Serializable < Reference < Object

A Realtime session configuration object.

Constructors

new(id : String | Nil = nil, object : String | Nil = nil, expires_at : Int64 | Nil = nil, include_value : Array(RealtimeSessionCreateResponseIncludeItem) | Nil = nil, model : String | Nil = nil, output_modalities : Hash(String, JSON::Any) | Nil = nil, instructions : String | Nil = nil, audio : RealtimeSessionCreateResponseAudio | Nil = nil, tracing : RealtimeSessionCreateResponseTracing | Nil = nil, turn_detection : RealtimeSessionCreateResponseTurnDetection | Nil = nil, tools : Array(RealtimeFunctionTool) | Nil = nil, tool_choice : String | Nil = nil, max_output_tokens : RealtimeSessionCreateResponseMaxOutputTokens | Nil = nil)
Source
new(*, __pull_for_json_serializable pull : JSON::PullParser)
Source

Instance methods

audio

Configuration for input and output audio for the session.

Source
audio=(audio : RealtimeSessionCreateResponseAudio | Nil)

Configuration for input and output audio for the session.

Source
expires_at

Expiration timestamp for the session, in seconds since epoch.

Source
expires_at=(expires_at : Int64 | Nil)

Expiration timestamp for the session, in seconds since epoch.

Source
id

Unique identifier for the session that looks like sess_1234567890abcdef.

Source
id=(id : String | Nil)

Unique identifier for the session that looks like sess_1234567890abcdef.

Source
include_value

Additional fields to include in server outputs.

  • item.input_audio_transcription.logprobs: Include logprobs for input audio transcription.
Source
include_value=(include_value : Array(RealtimeSessionCreateResponseIncludeItem) | Nil)

Additional fields to include in server outputs.

  • item.input_audio_transcription.logprobs: Include logprobs for input audio transcription.
Source
instructions

The default system instructions (i.e. system message) prepended to model calls. This field allows the client to guide the model on desired responses. The model can be instructed on response content and format, (e.g. "be extremely succinct", "act friendly", "here are examples of good responses") and on audio behavior (e.g. "talk quickly", "inject emotion into your voice", "laugh frequently"). The instructions are not guaranteed to be followed by the model, but they provide guidance to the model on the desired behavior.

Note that the server sets default instructions which will be used if this field is not set and are visible in the session.created event at the start of the session.

Source
instructions=(instructions : String | Nil)

The default system instructions (i.e. system message) prepended to model calls. This field allows the client to guide the model on desired responses. The model can be instructed on response content and format, (e.g. "be extremely succinct", "act friendly", "here are examples of good responses") and on audio behavior (e.g. "talk quickly", "inject emotion into your voice", "laugh frequently"). The instructions are not guaranteed to be followed by the model, but they provide guidance to the model on the desired behavior.

Note that the server sets default instructions which will be used if this field is not set and are visible in the session.created event at the start of the session.

Source
max_output_tokens

Maximum number of output tokens for a single assistant response, inclusive of tool calls. Provide an integer between 1 and 4096 to limit output tokens, or inf for the maximum available tokens for a given model. Defaults to inf.

Source
max_output_tokens=(max_output_tokens : RealtimeSessionCreateResponseMaxOutputTokens | Nil)

Maximum number of output tokens for a single assistant response, inclusive of tool calls. Provide an integer between 1 and 4096 to limit output tokens, or inf for the maximum available tokens for a given model. Defaults to inf.

Source
model

The Realtime model used for this session.

Source
model=(model : String | Nil)

The Realtime model used for this session.

Source
object

The object type. Always realtime.session.

Source
object=(object : String | Nil)

The object type. Always realtime.session.

Source
output_modalities

The set of modalities the model can respond with. To disable audio, set this to ["text"].

Source
output_modalities=(output_modalities : Hash(String, JSON::Any) | Nil)

The set of modalities the model can respond with. To disable audio, set this to ["text"].

Source
tool_choice

How the model chooses tools. Options are auto, none, required, or specify a function.

Source
tool_choice=(tool_choice : String | Nil)

How the model chooses tools. Options are auto, none, required, or specify a function.

Source
tools

Tools (functions) available to the model.

Source
tools=(tools : Array(RealtimeFunctionTool) | Nil)

Tools (functions) available to the model.

Source
tracing

Configuration options for tracing. Set to null to disable tracing. Once tracing is enabled for a session, the configuration cannot be modified.

auto will create a trace for the session with default values for the workflow name, group id, and metadata.

Source
tracing=(tracing : RealtimeSessionCreateResponseTracing | Nil)

Configuration options for tracing. Set to null to disable tracing. Once tracing is enabled for a session, the configuration cannot be modified.

auto will create a trace for the session with default values for the workflow name, group id, and metadata.

Source
turn_detection

Configuration for turn detection. Can be set to null to turn off. Server VAD means that the model will detect the start and end of speech based on audio volume and respond at the end of user speech.

Source
turn_detection=(turn_detection : RealtimeSessionCreateResponseTurnDetection | Nil)

Configuration for turn detection. Can be set to null to turn off. Server VAD means that the model will detect the start and end of speech based on audio volume and respond at the end of user speech.

Source