class

OpenAI::RealtimeSessionCreateResponseGA

Inherits JSON::Serializable < Reference < Object

A new Realtime session configuration, with an ephemeral key. Default TTL for keys is one minute.

Constructors

new(client_secret : RealtimeSessionCreateResponseGAClientSecret = RealtimeSessionCreateResponseGAClientSecret.new, type_value : RealtimeSessionCreateResponseGAType = RealtimeSessionCreateResponseGAType::Realtime, output_modalities : Array(RealtimeSessionCreateResponseGAOutputModalitiesItem) | Nil = nil, model : RealtimeSessionCreateResponseGAModel | Nil = nil, instructions : String | Nil = nil, audio : RealtimeSessionCreateResponseGAAudio | Nil = nil, include_value : Array(RealtimeSessionCreateResponseGAIncludeItem) | Nil = nil, tracing : RealtimeSessionCreateResponseGATracing | Nil = nil, tools : Array(RealtimeSessionCreateResponseGAToolsItem) | Nil = nil, tool_choice : RealtimeSessionCreateResponseGAToolChoice | Nil = nil, max_output_tokens : RealtimeSessionCreateResponseGAMaxOutputTokens | Nil = nil, truncation : RealtimeTruncation | Nil = nil, prompt : Prompt | Nil = nil)
Source
new(*, __pull_for_json_serializable pull : JSON::PullParser)
Source

Instance methods

audio

Configuration for input and output audio.

Source
audio=(audio : RealtimeSessionCreateResponseGAAudio | Nil)

Configuration for input and output audio.

Source
client_secret

Ephemeral key returned by the API.

Source
client_secret=(client_secret : RealtimeSessionCreateResponseGAClientSecret)

Ephemeral key returned by the API.

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(RealtimeSessionCreateResponseGAIncludeItem) | 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 : RealtimeSessionCreateResponseGAMaxOutputTokens | 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 : RealtimeSessionCreateResponseGAModel | Nil)

The Realtime model used for this session.

Source
output_modalities

The set of modalities the model can respond with. It defaults to ["audio"], indicating that the model will respond with audio plus a transcript. ["text"] can be used to make the model respond with text only. It is not possible to request both text and audio at the same time.

Source
output_modalities=(output_modalities : Array(RealtimeSessionCreateResponseGAOutputModalitiesItem) | Nil)

The set of modalities the model can respond with. It defaults to ["audio"], indicating that the model will respond with audio plus a transcript. ["text"] can be used to make the model respond with text only. It is not possible to request both text and audio at the same time.

Source
prompt
Source
prompt=(prompt : Prompt | Nil)
Source
tool_choice

How the model chooses tools. Provide one of the string modes or force a specific function/MCP tool.

Source
tool_choice=(tool_choice : RealtimeSessionCreateResponseGAToolChoice | Nil)

How the model chooses tools. Provide one of the string modes or force a specific function/MCP tool.

Source
tools

Tools available to the model.

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

Tools available to the model.

Source
tracing
Source
tracing=(tracing : RealtimeSessionCreateResponseGATracing | Nil)
Source
truncation
Source
truncation=(truncation : RealtimeTruncation | Nil)
Source
type_value

The type of session to create. Always realtime for the Realtime API.

Source
type_value=(type_value : RealtimeSessionCreateResponseGAType)

The type of session to create. Always realtime for the Realtime API.

Source