Class RealtimeResponseCreateParams
-
- All Implemented Interfaces:
public final class RealtimeResponseCreateParams
Create a new Realtime response with these parameters
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public final class
RealtimeResponseCreateParams.Builder
A builder for RealtimeResponseCreateParams.
public final class
RealtimeResponseCreateParams.Conversation
Controls which conversation the response is added to. Currently supports
auto
andnone
, withauto
as the default value. Theauto
value means that the contents of the response will be added to the default conversation. Set this tonone
to create an out-of-band response which will not add items to default conversation.public final class
RealtimeResponseCreateParams.MaxOutputTokens
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 toinf
.public final class
RealtimeResponseCreateParams.Metadata
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.
public final class
RealtimeResponseCreateParams.OutputModality
public final class
RealtimeResponseCreateParams.ToolChoice
How the model chooses tools. Provide one of the string modes or force a specific function/MCP tool.
public final class
RealtimeResponseCreateParams.Tool
Give the model access to additional tools via remote Model Context Protocol (MCP) servers. Learn more about MCP.
-
Method Summary
-
-
Method Detail
-
audio
final Optional<RealtimeResponseCreateAudioOutput> audio()
Configuration for audio input and output.
-
conversation
final Optional<RealtimeResponseCreateParams.Conversation> conversation()
Controls which conversation the response is added to. Currently supports
auto
andnone
, withauto
as the default value. Theauto
value means that the contents of the response will be added to the default conversation. Set this tonone
to create an out-of-band response which will not add items to default conversation.
-
input
final Optional<List<ConversationItem>> input()
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.
-
instructions
final Optional<String> 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.
-
maxOutputTokens
final Optional<RealtimeResponseCreateParams.MaxOutputTokens> maxOutputTokens()
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 toinf
.
-
metadata
final Optional<RealtimeResponseCreateParams.Metadata> metadata()
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.
-
outputModalities
final Optional<List<RealtimeResponseCreateParams.OutputModality>> outputModalities()
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 modetext
will disable audio output from the model.
-
prompt
final Optional<ResponsePrompt> prompt()
Reference to a prompt template and its variables. Learn more.
-
toolChoice
final Optional<RealtimeResponseCreateParams.ToolChoice> toolChoice()
How the model chooses tools. Provide one of the string modes or force a specific function/MCP tool.
-
tools
final Optional<List<RealtimeResponseCreateParams.Tool>> tools()
Tools available to the model.
-
_audio
final JsonField<RealtimeResponseCreateAudioOutput> _audio()
Returns the raw JSON value of audio.
Unlike audio, this method doesn't throw if the JSON field has an unexpected type.
-
_conversation
final JsonField<RealtimeResponseCreateParams.Conversation> _conversation()
Returns the raw JSON value of conversation.
Unlike conversation, this method doesn't throw if the JSON field has an unexpected type.
-
_input
final JsonField<List<ConversationItem>> _input()
Returns the raw JSON value of input.
Unlike input, this method doesn't throw if the JSON field has an unexpected type.
-
_instructions
final JsonField<String> _instructions()
Returns the raw JSON value of instructions.
Unlike instructions, this method doesn't throw if the JSON field has an unexpected type.
-
_maxOutputTokens
final JsonField<RealtimeResponseCreateParams.MaxOutputTokens> _maxOutputTokens()
Returns the raw JSON value of maxOutputTokens.
Unlike maxOutputTokens, this method doesn't throw if the JSON field has an unexpected type.
-
_metadata
final JsonField<RealtimeResponseCreateParams.Metadata> _metadata()
Returns the raw JSON value of metadata.
Unlike metadata, this method doesn't throw if the JSON field has an unexpected type.
-
_outputModalities
final JsonField<List<RealtimeResponseCreateParams.OutputModality>> _outputModalities()
Returns the raw JSON value of outputModalities.
Unlike outputModalities, this method doesn't throw if the JSON field has an unexpected type.
-
_prompt
final JsonField<ResponsePrompt> _prompt()
Returns the raw JSON value of prompt.
Unlike prompt, this method doesn't throw if the JSON field has an unexpected type.
-
_toolChoice
final JsonField<RealtimeResponseCreateParams.ToolChoice> _toolChoice()
Returns the raw JSON value of toolChoice.
Unlike toolChoice, this method doesn't throw if the JSON field has an unexpected type.
-
_tools
final JsonField<List<RealtimeResponseCreateParams.Tool>> _tools()
Returns the raw JSON value of tools.
Unlike tools, this method doesn't throw if the JSON field has an unexpected type.
-
_additionalProperties
final Map<String, JsonValue> _additionalProperties()
-
toBuilder
final RealtimeResponseCreateParams.Builder toBuilder()
-
validate
final RealtimeResponseCreateParams validate()
-
builder
final static RealtimeResponseCreateParams.Builder builder()
Returns a mutable builder for constructing an instance of RealtimeResponseCreateParams.
-
-
-
-