Class: OpenAI::Models::Realtime::ResponseCreateEvent::Response
- Inherits:
-
Internal::Type::BaseModel
- Object
- Internal::Type::BaseModel
- OpenAI::Models::Realtime::ResponseCreateEvent::Response
- Defined in:
- lib/openai/models/realtime/response_create_event.rb
Overview
Defined Under Namespace
Modules: Conversation, MaxOutputTokens, Modality, OutputAudioFormat, ToolChoice, Voice Classes: Tool
Instance Attribute Summary collapse
-
#conversation ⇒ String, ...
Controls which conversation the response is added to.
-
#input ⇒ Array<OpenAI::Models::Realtime::RealtimeConversationItemSystemMessage, OpenAI::Models::Realtime::RealtimeConversationItemUserMessage, OpenAI::Models::Realtime::RealtimeConversationItemAssistantMessage, OpenAI::Models::Realtime::RealtimeConversationItemFunctionCall, OpenAI::Models::Realtime::RealtimeConversationItemFunctionCallOutput, OpenAI::Models::Realtime::RealtimeMcpApprovalResponse, OpenAI::Models::Realtime::RealtimeMcpListTools, OpenAI::Models::Realtime::RealtimeMcpToolCall, OpenAI::Models::Realtime::RealtimeMcpApprovalRequest>?
Input items to include in the prompt for the model.
-
#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.
-
#metadata ⇒ Hash{Symbol=>String}?
Set of 16 key-value pairs that can be attached to an object.
-
#modalities ⇒ Array<Symbol, OpenAI::Models::Realtime::ResponseCreateEvent::Response::Modality>?
The set of modalities the model can respond with.
-
#output_audio_format ⇒ Symbol, ...
The format of output audio.
-
#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::ResponseCreateEvent::Response::Tool>?
Tools (functions) available to the model.
-
#voice ⇒ String, ...
The voice the model uses to respond.
Class Method Summary collapse
- .values ⇒ Array<Symbol>
- .variants ⇒ Array(Symbol, OpenAI::Models::Responses::ToolChoiceOptions, OpenAI::Models::Responses::ToolChoiceFunction, OpenAI::Models::Responses::ToolChoiceMcp)
Instance Method Summary collapse
-
#initialize(conversation: nil, input: nil, instructions: nil, max_output_tokens: nil, metadata: nil, modalities: nil, output_audio_format: nil, prompt: nil, temperature: nil, tool_choice: nil, tools: nil, voice: nil) ⇒ Object
constructor
Some parameter documentations has been truncated, see Response 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(conversation: nil, input: nil, instructions: nil, max_output_tokens: nil, metadata: nil, modalities: nil, output_audio_format: nil, prompt: nil, temperature: nil, tool_choice: nil, tools: nil, voice: nil) ⇒ Object
Some parameter documentations has been truncated, see OpenAI::Models::Realtime::ResponseCreateEvent::Response for more details.
Create a new Realtime response with these parameters
|
|
# File 'lib/openai/models/realtime/response_create_event.rb', line 155
|
Instance Attribute Details
#conversation ⇒ String, ...
Controls which conversation the response is added to. Currently supports ‘auto` and `none`, with `auto` as the default value. The `auto` value means that the contents of the response will be added to the default conversation. Set this to `none` to create an out-of-band response which will not add items to default conversation.
58 |
# File 'lib/openai/models/realtime/response_create_event.rb', line 58 optional :conversation, union: -> { OpenAI::Realtime::ResponseCreateEvent::Response::Conversation } |
#input ⇒ Array<OpenAI::Models::Realtime::RealtimeConversationItemSystemMessage, OpenAI::Models::Realtime::RealtimeConversationItemUserMessage, OpenAI::Models::Realtime::RealtimeConversationItemAssistantMessage, OpenAI::Models::Realtime::RealtimeConversationItemFunctionCall, OpenAI::Models::Realtime::RealtimeConversationItemFunctionCallOutput, OpenAI::Models::Realtime::RealtimeMcpApprovalResponse, OpenAI::Models::Realtime::RealtimeMcpListTools, OpenAI::Models::Realtime::RealtimeMcpToolCall, OpenAI::Models::Realtime::RealtimeMcpApprovalRequest>?
Input items to include in the prompt for the model. Using this field creates a new context for this Response instead of using the default conversation. An empty array ‘[]` will clear the context for this Response. Note that this can include references to items from the default conversation.
67 |
# File 'lib/openai/models/realtime/response_create_event.rb', line 67 optional :input, -> { OpenAI::Internal::Type::ArrayOf[union: OpenAI::Realtime::ConversationItem] } |
#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.
83 |
# File 'lib/openai/models/realtime/response_create_event.rb', line 83 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`.
91 92 |
# File 'lib/openai/models/realtime/response_create_event.rb', line 91 optional :max_output_tokens, union: -> { OpenAI::Realtime::ResponseCreateEvent::Response::MaxOutputTokens } |
#metadata ⇒ Hash{Symbol=>String}?
Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format, and querying for objects via API or the dashboard.
Keys are strings with a maximum length of 64 characters. Values are strings with a maximum length of 512 characters.
103 |
# File 'lib/openai/models/realtime/response_create_event.rb', line 103 optional :metadata, OpenAI::Internal::Type::HashOf[String], nil?: true |
#modalities ⇒ Array<Symbol, OpenAI::Models::Realtime::ResponseCreateEvent::Response::Modality>?
The set of modalities the model can respond with. To disable audio, set this to [“text”].
110 111 |
# File 'lib/openai/models/realtime/response_create_event.rb', line 110 optional :modalities, -> { OpenAI::Internal::Type::ArrayOf[enum: OpenAI::Realtime::ResponseCreateEvent::Response::Modality] } |
#output_audio_format ⇒ Symbol, ...
The format of output audio. Options are ‘pcm16`, `g711_ulaw`, or `g711_alaw`.
117 118 |
# File 'lib/openai/models/realtime/response_create_event.rb', line 117 optional :output_audio_format, enum: -> { OpenAI::Realtime::ResponseCreateEvent::Response::OutputAudioFormat } |
#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).
125 |
# File 'lib/openai/models/realtime/response_create_event.rb', line 125 optional :prompt, -> { OpenAI::Responses::ResponsePrompt }, nil?: true |
#temperature ⇒ Float?
Sampling temperature for the model, limited to [0.6, 1.2]. Defaults to 0.8.
131 |
# File 'lib/openai/models/realtime/response_create_event.rb', line 131 optional :temperature, Float |
#tool_choice ⇒ Symbol, ...
How the model chooses tools. Provide one of the string modes or force a specific function/MCP tool.
138 |
# File 'lib/openai/models/realtime/response_create_event.rb', line 138 optional :tool_choice, union: -> { OpenAI::Realtime::ResponseCreateEvent::Response::ToolChoice } |
#tools ⇒ Array<OpenAI::Models::Realtime::ResponseCreateEvent::Response::Tool>?
Tools (functions) available to the model.
144 145 |
# File 'lib/openai/models/realtime/response_create_event.rb', line 144 optional :tools, -> { OpenAI::Internal::Type::ArrayOf[OpenAI::Realtime::ResponseCreateEvent::Response::Tool] } |
#voice ⇒ String, ...
The voice the model uses to respond. Voice cannot be changed during the session once the model has responded with audio at least once. Current voice options are ‘alloy`, `ash`, `ballad`, `coral`, `echo`, `sage`, `shimmer`, and `verse`.
153 |
# File 'lib/openai/models/realtime/response_create_event.rb', line 153 optional :voice, union: -> { OpenAI::Realtime::ResponseCreateEvent::Response::Voice } |
Class Method Details
.values ⇒ Array<Symbol>
|
|
# File 'lib/openai/models/realtime/response_create_event.rb', line 238
|
.variants ⇒ Array(Symbol, OpenAI::Models::Responses::ToolChoiceOptions, OpenAI::Models::Responses::ToolChoiceFunction, OpenAI::Models::Responses::ToolChoiceMcp)
|
|
# File 'lib/openai/models/realtime/response_create_event.rb', line 228
|