Class RealtimeResponseCreateParams.Builder
-
- All Implemented Interfaces:
public final class RealtimeResponseCreateParams.Builder
A builder for RealtimeResponseCreateParams.
-
-
Method Summary
-
-
Method Detail
-
audio
final RealtimeResponseCreateParams.Builder audio(RealtimeResponseCreateAudioOutput audio)
Configuration for audio input and output.
-
audio
final RealtimeResponseCreateParams.Builder audio(JsonField<RealtimeResponseCreateAudioOutput> audio)
Sets Builder.audio to an arbitrary JSON value.
You should usually call Builder.audio with a well-typed RealtimeResponseCreateAudioOutput value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
conversation
final RealtimeResponseCreateParams.Builder conversation(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.
-
conversation
final RealtimeResponseCreateParams.Builder conversation(JsonField<RealtimeResponseCreateParams.Conversation> conversation)
Sets Builder.conversation to an arbitrary JSON value.
You should usually call Builder.conversation with a well-typed Conversation value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
conversation
final RealtimeResponseCreateParams.Builder conversation(String value)
Sets conversation to an arbitrary String.
You should usually call conversation with a well-typed Conversation constant instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
input
final RealtimeResponseCreateParams.Builder input(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.
-
input
final RealtimeResponseCreateParams.Builder input(JsonField<List<ConversationItem>> input)
Sets Builder.input to an arbitrary JSON value.
You should usually call Builder.input with a well-typed
List<ConversationItem>
value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
addInput
final RealtimeResponseCreateParams.Builder addInput(ConversationItem input)
Adds a single ConversationItem to Builder.input.
-
addInput
final RealtimeResponseCreateParams.Builder addInput(RealtimeConversationItemSystemMessage realtimeConversationItemSystemMessage)
Alias for calling addInput with
ConversationItem.ofRealtimeConversationItemSystemMessage(realtimeConversationItemSystemMessage)
.
-
addInput
final RealtimeResponseCreateParams.Builder addInput(RealtimeConversationItemUserMessage realtimeConversationItemUserMessage)
Alias for calling addInput with
ConversationItem.ofRealtimeConversationItemUserMessage(realtimeConversationItemUserMessage)
.
-
addInput
final RealtimeResponseCreateParams.Builder addInput(RealtimeConversationItemAssistantMessage realtimeConversationItemAssistantMessage)
Alias for calling addInput with
ConversationItem.ofRealtimeConversationItemAssistantMessage(realtimeConversationItemAssistantMessage)
.
-
addInput
final RealtimeResponseCreateParams.Builder addInput(RealtimeConversationItemFunctionCall functionCall)
Alias for calling addInput with
ConversationItem.ofFunctionCall(functionCall)
.
-
addInput
final RealtimeResponseCreateParams.Builder addInput(RealtimeConversationItemFunctionCallOutput functionCallOutput)
Alias for calling addInput with
ConversationItem.ofFunctionCallOutput(functionCallOutput)
.
-
addInput
final RealtimeResponseCreateParams.Builder addInput(RealtimeMcpApprovalResponse mcpApprovalResponse)
Alias for calling addInput with
ConversationItem.ofMcpApprovalResponse(mcpApprovalResponse)
.
-
addInput
final RealtimeResponseCreateParams.Builder addInput(RealtimeMcpListTools mcpListTools)
Alias for calling addInput with
ConversationItem.ofMcpListTools(mcpListTools)
.
-
addInput
final RealtimeResponseCreateParams.Builder addInput(RealtimeMcpToolCall mcpCall)
Alias for calling addInput with
ConversationItem.ofMcpCall(mcpCall)
.
-
addInput
final RealtimeResponseCreateParams.Builder addInput(RealtimeMcpApprovalRequest mcpApprovalRequest)
Alias for calling addInput with
ConversationItem.ofMcpApprovalRequest(mcpApprovalRequest)
.
-
addRealtimeConversationItemSystemMessageInput
final RealtimeResponseCreateParams.Builder addRealtimeConversationItemSystemMessageInput(List<RealtimeConversationItemSystemMessage.Content> content)
Alias for calling addInput with the following:
RealtimeConversationItemSystemMessage.builder() .content(content) .build()
-
addRealtimeConversationItemUserMessageInput
final RealtimeResponseCreateParams.Builder addRealtimeConversationItemUserMessageInput(List<RealtimeConversationItemUserMessage.Content> content)
Alias for calling addInput with the following:
RealtimeConversationItemUserMessage.builder() .content(content) .build()
-
addRealtimeConversationItemAssistantMessageInput
final RealtimeResponseCreateParams.Builder addRealtimeConversationItemAssistantMessageInput(List<RealtimeConversationItemAssistantMessage.Content> content)
Alias for calling addInput with the following:
RealtimeConversationItemAssistantMessage.builder() .content(content) .build()
-
instructions
final RealtimeResponseCreateParams.Builder instructions(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.
-
instructions
final RealtimeResponseCreateParams.Builder instructions(JsonField<String> instructions)
Sets Builder.instructions to an arbitrary JSON value.
You should usually call Builder.instructions with a well-typed String value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
maxOutputTokens
final RealtimeResponseCreateParams.Builder maxOutputTokens(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
.
-
maxOutputTokens
final RealtimeResponseCreateParams.Builder maxOutputTokens(JsonField<RealtimeResponseCreateParams.MaxOutputTokens> maxOutputTokens)
Sets Builder.maxOutputTokens to an arbitrary JSON value.
You should usually call Builder.maxOutputTokens with a well-typed MaxOutputTokens value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
maxOutputTokens
final RealtimeResponseCreateParams.Builder maxOutputTokens(Long integer)
Alias for calling maxOutputTokens with
MaxOutputTokens.ofInteger(integer)
.
-
maxOutputTokensInf
final RealtimeResponseCreateParams.Builder maxOutputTokensInf()
Alias for calling maxOutputTokens with
MaxOutputTokens.ofInf()
.
-
metadata
final RealtimeResponseCreateParams.Builder metadata(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.
-
metadata
final RealtimeResponseCreateParams.Builder metadata(Optional<RealtimeResponseCreateParams.Metadata> metadata)
Alias for calling Builder.metadata with
metadata.orElse(null)
.
-
metadata
final RealtimeResponseCreateParams.Builder metadata(JsonField<RealtimeResponseCreateParams.Metadata> metadata)
Sets Builder.metadata to an arbitrary JSON value.
You should usually call Builder.metadata with a well-typed Metadata value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
outputModalities
final RealtimeResponseCreateParams.Builder outputModalities(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.
-
outputModalities
final RealtimeResponseCreateParams.Builder outputModalities(JsonField<List<RealtimeResponseCreateParams.OutputModality>> outputModalities)
Sets Builder.outputModalities to an arbitrary JSON value.
You should usually call Builder.outputModalities with a well-typed
List<OutputModality>
value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
addOutputModality
final RealtimeResponseCreateParams.Builder addOutputModality(RealtimeResponseCreateParams.OutputModality outputModality)
Adds a single OutputModality to outputModalities.
-
prompt
final RealtimeResponseCreateParams.Builder prompt(ResponsePrompt prompt)
Reference to a prompt template and its variables. Learn more.
-
prompt
final RealtimeResponseCreateParams.Builder prompt(Optional<ResponsePrompt> prompt)
Alias for calling Builder.prompt with
prompt.orElse(null)
.
-
prompt
final RealtimeResponseCreateParams.Builder prompt(JsonField<ResponsePrompt> prompt)
Sets Builder.prompt to an arbitrary JSON value.
You should usually call Builder.prompt with a well-typed ResponsePrompt value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
toolChoice
final RealtimeResponseCreateParams.Builder toolChoice(RealtimeResponseCreateParams.ToolChoice toolChoice)
How the model chooses tools. Provide one of the string modes or force a specific function/MCP tool.
-
toolChoice
final RealtimeResponseCreateParams.Builder toolChoice(JsonField<RealtimeResponseCreateParams.ToolChoice> toolChoice)
Sets Builder.toolChoice to an arbitrary JSON value.
You should usually call Builder.toolChoice with a well-typed ToolChoice value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
toolChoice
final RealtimeResponseCreateParams.Builder toolChoice(ToolChoiceOptions options)
Alias for calling toolChoice with
ToolChoice.ofOptions(options)
.
-
toolChoice
final RealtimeResponseCreateParams.Builder toolChoice(ToolChoiceFunction function)
Alias for calling toolChoice with
ToolChoice.ofFunction(function)
.
-
toolChoice
final RealtimeResponseCreateParams.Builder toolChoice(ToolChoiceMcp mcp)
Alias for calling toolChoice with
ToolChoice.ofMcp(mcp)
.
-
tools
final RealtimeResponseCreateParams.Builder tools(List<RealtimeResponseCreateParams.Tool> tools)
Tools available to the model.
-
tools
final RealtimeResponseCreateParams.Builder tools(JsonField<List<RealtimeResponseCreateParams.Tool>> tools)
Sets Builder.tools to an arbitrary JSON value.
You should usually call Builder.tools with a well-typed
List<Tool>
value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
addTool
final RealtimeResponseCreateParams.Builder addTool(RealtimeResponseCreateParams.Tool tool)
-
addTool
final RealtimeResponseCreateParams.Builder addTool(RealtimeFunctionTool realtimeFunction)
Alias for calling addTool with
Tool.ofRealtimeFunction(realtimeFunction)
.
-
addTool
final RealtimeResponseCreateParams.Builder addTool(RealtimeResponseCreateMcpTool realtimeResponseCreateMcp)
Alias for calling addTool with
Tool.ofRealtimeResponseCreateMcp(realtimeResponseCreateMcp)
.
-
additionalProperties
final RealtimeResponseCreateParams.Builder additionalProperties(Map<String, JsonValue> additionalProperties)
-
putAdditionalProperty
final RealtimeResponseCreateParams.Builder putAdditionalProperty(String key, JsonValue value)
-
putAllAdditionalProperties
final RealtimeResponseCreateParams.Builder putAllAdditionalProperties(Map<String, JsonValue> additionalProperties)
-
removeAdditionalProperty
final RealtimeResponseCreateParams.Builder removeAdditionalProperty(String key)
-
removeAllAdditionalProperties
final RealtimeResponseCreateParams.Builder removeAllAdditionalProperties(Set<String> keys)
-
build
final RealtimeResponseCreateParams build()
Returns an immutable instance of RealtimeResponseCreateParams.
Further updates to this Builder will not mutate the returned instance.
-
-
-
-