Class: OpenAI::Models::Realtime::RealtimeSessionCreateRequest
- Inherits:
-
Internal::Type::BaseModel
- Object
- Internal::Type::BaseModel
- OpenAI::Models::Realtime::RealtimeSessionCreateRequest
- Defined in:
- lib/openai/models/realtime/realtime_session_create_request.rb
Defined Under Namespace
Modules: Include, MaxOutputTokens, Model, OutputModality
Instance Attribute Summary collapse
-
#audio ⇒ OpenAI::Models::Realtime::RealtimeAudioConfig?
Configuration for input and output audio.
-
#client_secret ⇒ OpenAI::Models::Realtime::RealtimeClientSecretConfig?
Configuration options for the generated client secret.
-
#include ⇒ Array<Symbol, OpenAI::Models::Realtime::RealtimeSessionCreateRequest::Include>?
Additional fields to include in server outputs.
-
#instructions ⇒ String?
The default system instructions (i.e. system message) prepended to model calls.
-
#max_output_tokens ⇒ Integer, ...
Maximum number of output tokens for a single assistant response, inclusive of tool calls.
-
#model ⇒ String, ...
The Realtime model used for this session.
-
#output_modalities ⇒ Array<Symbol, OpenAI::Models::Realtime::RealtimeSessionCreateRequest::OutputModality>?
The set of modalities the model can respond with.
-
#prompt ⇒ OpenAI::Models::Responses::ResponsePrompt?
Reference to a prompt template and its variables.
-
#temperature ⇒ Float?
Sampling temperature for the model, limited to [0.6, 1.2].
-
#tool_choice ⇒ Symbol, ...
How the model chooses tools.
-
#tools ⇒ Array<OpenAI::Models::Realtime::RealtimeToolsConfigUnion::Function, OpenAI::Models::Realtime::RealtimeToolsConfigUnion::Mcp>?
Tools available to the model.
-
#tracing ⇒ Symbol, ...
Configuration options for tracing.
-
#truncation ⇒ Symbol, ...
Controls how the realtime conversation is truncated prior to model inference.
-
#type ⇒ Symbol, :realtime
The type of session to create.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(model: , audio: nil, client_secret: nil, include: nil, instructions: nil, max_output_tokens: nil, output_modalities: nil, prompt: nil, temperature: nil, tool_choice: nil, tools: nil, tracing: nil, truncation: nil, type: :realtime) ⇒ Object
constructor
Some parameter documentations has been truncated, see RealtimeSessionCreateRequest for more details.
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(model: , audio: nil, client_secret: nil, include: nil, instructions: nil, max_output_tokens: nil, output_modalities: nil, prompt: nil, temperature: nil, tool_choice: nil, tools: nil, tracing: nil, truncation: nil, type: :realtime) ⇒ Object
Some parameter documentations has been truncated, see OpenAI::Models::Realtime::RealtimeSessionCreateRequest for more details.
Realtime session object configuration.
|
|
# File 'lib/openai/models/realtime/realtime_session_create_request.rb', line 118
|
Instance Attribute Details
#audio ⇒ OpenAI::Models::Realtime::RealtimeAudioConfig?
Configuration for input and output audio.
23 |
# File 'lib/openai/models/realtime/realtime_session_create_request.rb', line 23 optional :audio, -> { OpenAI::Realtime::RealtimeAudioConfig } |
#client_secret ⇒ OpenAI::Models::Realtime::RealtimeClientSecretConfig?
Configuration options for the generated client secret.
29 |
# File 'lib/openai/models/realtime/realtime_session_create_request.rb', line 29 optional :client_secret, -> { OpenAI::Realtime::RealtimeClientSecretConfig } |
#include ⇒ Array<Symbol, OpenAI::Models::Realtime::RealtimeSessionCreateRequest::Include>?
Additional fields to include in server outputs.
-
‘item.input_audio_transcription.logprobs`: Include logprobs for input audio transcription.
38 39 |
# File 'lib/openai/models/realtime/realtime_session_create_request.rb', line 38 optional :include, -> { OpenAI::Internal::Type::ArrayOf[enum: OpenAI::Realtime::RealtimeSessionCreateRequest::Include] } |
#instructions ⇒ String?
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.
55 |
# File 'lib/openai/models/realtime/realtime_session_create_request.rb', line 55 optional :instructions, String |
#max_output_tokens ⇒ Integer, ...
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`.
63 |
# File 'lib/openai/models/realtime/realtime_session_create_request.rb', line 63 optional :max_output_tokens, union: -> { OpenAI::Realtime::RealtimeSessionCreateRequest::MaxOutputTokens } |
#model ⇒ String, ...
The Realtime model used for this session.
11 |
# File 'lib/openai/models/realtime/realtime_session_create_request.rb', line 11 required :model, union: -> { OpenAI::Realtime::RealtimeSessionCreateRequest::Model } |
#output_modalities ⇒ Array<Symbol, OpenAI::Models::Realtime::RealtimeSessionCreateRequest::OutputModality>?
The set of modalities the model can respond with. To disable audio, set this to [“text”].
70 71 |
# File 'lib/openai/models/realtime/realtime_session_create_request.rb', line 70 optional :output_modalities, -> { OpenAI::Internal::Type::ArrayOf[enum: OpenAI::Realtime::RealtimeSessionCreateRequest::OutputModality] } |
#prompt ⇒ OpenAI::Models::Responses::ResponsePrompt?
Reference to a prompt template and its variables. [Learn more](platform.openai.com/docs/guides/text?api-mode=responses#reusable-prompts).
78 |
# File 'lib/openai/models/realtime/realtime_session_create_request.rb', line 78 optional :prompt, -> { OpenAI::Responses::ResponsePrompt }, nil?: true |
#temperature ⇒ Float?
Sampling temperature for the model, limited to [0.6, 1.2]. For audio models a temperature of 0.8 is highly recommended for best performance.
85 |
# File 'lib/openai/models/realtime/realtime_session_create_request.rb', line 85 optional :temperature, Float |
#tool_choice ⇒ Symbol, ...
How the model chooses tools. Provide one of the string modes or force a specific function/MCP tool.
92 |
# File 'lib/openai/models/realtime/realtime_session_create_request.rb', line 92 optional :tool_choice, union: -> { OpenAI::Realtime::RealtimeToolChoiceConfig } |
#tools ⇒ Array<OpenAI::Models::Realtime::RealtimeToolsConfigUnion::Function, OpenAI::Models::Realtime::RealtimeToolsConfigUnion::Mcp>?
Tools available to the model.
98 |
# File 'lib/openai/models/realtime/realtime_session_create_request.rb', line 98 optional :tools, -> { OpenAI::Internal::Type::ArrayOf[union: OpenAI::Realtime::RealtimeToolsConfigUnion] } |
#tracing ⇒ Symbol, ...
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.
108 |
# File 'lib/openai/models/realtime/realtime_session_create_request.rb', line 108 optional :tracing, union: -> { OpenAI::Realtime::RealtimeTracingConfig }, nil?: true |
#truncation ⇒ Symbol, ...
Controls how the realtime conversation is truncated prior to model inference. The default is ‘auto`. When set to `retention_ratio`, the server retains a fraction of the conversation tokens prior to the instructions.
116 |
# File 'lib/openai/models/realtime/realtime_session_create_request.rb', line 116 optional :truncation, union: -> { OpenAI::Realtime::RealtimeTruncation } |
#type ⇒ Symbol, :realtime
The type of session to create. Always ‘realtime` for the Realtime API.
17 |
# File 'lib/openai/models/realtime/realtime_session_create_request.rb', line 17 required :type, const: :realtime |
Class Method Details
.values ⇒ Array<Symbol>
|
|
# File 'lib/openai/models/realtime/realtime_session_create_request.rb', line 202
|
.variants ⇒ Array(Integer, Symbol, :inf)
|
|
# File 'lib/openai/models/realtime/realtime_session_create_request.rb', line 218
|