Class: OpenAI::Models::Realtime::RealtimeResponseCreateParams
- Inherits:
-
Internal::Type::BaseModel
- Object
- Internal::Type::BaseModel
- OpenAI::Models::Realtime::RealtimeResponseCreateParams
- Defined in:
- lib/openai/models/realtime/realtime_response_create_params.rb
Defined Under Namespace
Modules: Conversation, MaxOutputTokens, OutputModality, Tool, ToolChoice
Instance Attribute Summary collapse
-
#audio ⇒ OpenAI::Models::Realtime::RealtimeResponseCreateAudioOutput?
Configuration for audio input and output.
-
#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.
-
#output_modalities ⇒ Array<Symbol, OpenAI::Models::Realtime::RealtimeResponseCreateParams::OutputModality>?
The set of modalities the model used to respond, currently the only possible values are ‘["audio"]`, `["text"]`.
-
#prompt ⇒ OpenAI::Models::Responses::ResponsePrompt?
Reference to a prompt template and its variables.
-
#tool_choice ⇒ Symbol, ...
How the model chooses tools.
-
#tools ⇒ Array<OpenAI::Models::Realtime::RealtimeFunctionTool, OpenAI::Models::Realtime::RealtimeResponseCreateMcpTool>?
Tools available to the model.
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(audio: nil, conversation: nil, input: nil, instructions: nil, max_output_tokens: nil, metadata: nil, output_modalities: nil, prompt: nil, tool_choice: nil, tools: nil) ⇒ Object
constructor
Some parameter documentations has been truncated, see RealtimeResponseCreateParams 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(audio: nil, conversation: nil, input: nil, instructions: nil, max_output_tokens: nil, metadata: nil, output_modalities: nil, prompt: nil, tool_choice: nil, tools: nil) ⇒ Object
Some parameter documentations has been truncated, see OpenAI::Models::Realtime::RealtimeResponseCreateParams for more details.
Create a new Realtime response with these parameters
|
|
# File 'lib/openai/models/realtime/realtime_response_create_params.rb', line 97
|
Instance Attribute Details
#audio ⇒ OpenAI::Models::Realtime::RealtimeResponseCreateAudioOutput?
Configuration for audio input and output.
11 |
# File 'lib/openai/models/realtime/realtime_response_create_params.rb', line 11 optional :audio, -> { OpenAI::Realtime::RealtimeResponseCreateAudioOutput } |
#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.
21 |
# File 'lib/openai/models/realtime/realtime_response_create_params.rb', line 21 optional :conversation, union: -> { OpenAI::Realtime::RealtimeResponseCreateParams::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 that previously appeared in the session using their id.
31 |
# File 'lib/openai/models/realtime/realtime_response_create_params.rb', line 31 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.
45 |
# File 'lib/openai/models/realtime/realtime_response_create_params.rb', line 45 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`.
53 |
# File 'lib/openai/models/realtime/realtime_response_create_params.rb', line 53 optional :max_output_tokens, union: -> { OpenAI::Realtime::RealtimeResponseCreateParams::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.
64 |
# File 'lib/openai/models/realtime/realtime_response_create_params.rb', line 64 optional :metadata, OpenAI::Internal::Type::HashOf[String], nil?: true |
#output_modalities ⇒ Array<Symbol, OpenAI::Models::Realtime::RealtimeResponseCreateParams::OutputModality>?
The set of modalities the model used to respond, currently the only possible values are ‘["audio"]`, `["text"]`. Audio output always include a text transcript. Setting the output to mode `text` will disable audio output from the model.
73 74 |
# File 'lib/openai/models/realtime/realtime_response_create_params.rb', line 73 optional :output_modalities, -> { OpenAI::Internal::Type::ArrayOf[enum: OpenAI::Realtime::RealtimeResponseCreateParams::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).
81 |
# File 'lib/openai/models/realtime/realtime_response_create_params.rb', line 81 optional :prompt, -> { OpenAI::Responses::ResponsePrompt }, nil?: true |
#tool_choice ⇒ Symbol, ...
How the model chooses tools. Provide one of the string modes or force a specific function/MCP tool.
88 |
# File 'lib/openai/models/realtime/realtime_response_create_params.rb', line 88 optional :tool_choice, union: -> { OpenAI::Realtime::RealtimeResponseCreateParams::ToolChoice } |
#tools ⇒ Array<OpenAI::Models::Realtime::RealtimeFunctionTool, OpenAI::Models::Realtime::RealtimeResponseCreateMcpTool>?
Tools available to the model.
94 95 |
# File 'lib/openai/models/realtime/realtime_response_create_params.rb', line 94 optional :tools, -> { OpenAI::Internal::Type::ArrayOf[union: OpenAI::Realtime::RealtimeResponseCreateParams::Tool] } |
Class Method Details
.values ⇒ Array<Symbol>
|
|
# File 'lib/openai/models/realtime/realtime_response_create_params.rb', line 176
|
.variants ⇒ Array(Symbol, OpenAI::Models::Responses::ToolChoiceOptions, OpenAI::Models::Responses::ToolChoiceFunction, OpenAI::Models::Responses::ToolChoiceMcp)
|
|
# File 'lib/openai/models/realtime/realtime_response_create_params.rb', line 166
|