Class ResponsesClientEvent.Builder
-
- All Implemented Interfaces:
public final class ResponsesClientEvent.BuilderA builder for ResponsesClientEvent.
-
-
Method Summary
Modifier and Type Method Description final ResponsesClientEvent.Buildertype(JsonValue type)Sets the field to an arbitrary JSON value. final ResponsesClientEvent.Builderbackground(Boolean background)Whether to run the model response in the background. final ResponsesClientEvent.Builderbackground(Boolean background)Alias for Builder.background. final ResponsesClientEvent.Builderbackground(Optional<Boolean> background)Alias for calling Builder.background with background.orElse(null).final ResponsesClientEvent.Builderbackground(JsonField<Boolean> background)Sets Builder.background to an arbitrary JSON value. final ResponsesClientEvent.BuildercontextManagement(List<ResponsesClientEvent.ContextManagement> contextManagement)Context management configuration for this request. final ResponsesClientEvent.BuildercontextManagement(Optional<List<ResponsesClientEvent.ContextManagement>> contextManagement)Alias for calling Builder.contextManagement with contextManagement.orElse(null).final ResponsesClientEvent.BuildercontextManagement(JsonField<List<ResponsesClientEvent.ContextManagement>> contextManagement)Sets Builder.contextManagement to an arbitrary JSON value. final ResponsesClientEvent.BuilderaddContextManagement(ResponsesClientEvent.ContextManagement contextManagement)Adds a single ContextManagement to Builder.contextManagement. final ResponsesClientEvent.Builderconversation(ResponsesClientEvent.Conversation conversation)The conversation that this response belongs to. final ResponsesClientEvent.Builderconversation(Optional<ResponsesClientEvent.Conversation> conversation)Alias for calling Builder.conversation with conversation.orElse(null).final ResponsesClientEvent.Builderconversation(JsonField<ResponsesClientEvent.Conversation> conversation)Sets Builder.conversation to an arbitrary JSON value. final ResponsesClientEvent.Builderconversation(String id)Alias for calling conversation with Conversation.ofId(id).final ResponsesClientEvent.Builderconversation(ResponseConversationParam responseConversationParam)Alias for calling conversation with Conversation.ofResponseConversationParam(responseConversationParam).final ResponsesClientEvent.Builderinclude(List<ResponseIncludable> include)Specify additional output data to include in the model response. final ResponsesClientEvent.Builderinclude(Optional<List<ResponseIncludable>> include)Alias for calling Builder.include with include.orElse(null).final ResponsesClientEvent.Builderinclude(JsonField<List<ResponseIncludable>> include)Sets Builder.include to an arbitrary JSON value. final ResponsesClientEvent.BuilderaddInclude(ResponseIncludable include)Adds a single ResponseIncludable to Builder.include. final ResponsesClientEvent.Builderinput(ResponsesClientEvent.Input input)Text, image, or file inputs to the model, used to generate a response. final ResponsesClientEvent.Builderinput(JsonField<ResponsesClientEvent.Input> input)Sets Builder.input to an arbitrary JSON value. final ResponsesClientEvent.Builderinput(String text)Alias for calling input with Input.ofText(text).final ResponsesClientEvent.BuilderinputOfResponse(List<ResponseInputItem> response)Alias for calling input with Input.ofResponse(response).final ResponsesClientEvent.Builderinstructions(String instructions)A system (or developer) message inserted into the model's context. final ResponsesClientEvent.Builderinstructions(Optional<String> instructions)Alias for calling Builder.instructions with instructions.orElse(null).final ResponsesClientEvent.Builderinstructions(JsonField<String> instructions)Sets Builder.instructions to an arbitrary JSON value. final ResponsesClientEvent.BuildermaxOutputTokens(Long maxOutputTokens)An upper bound for the number of tokens that can be generated for a response, including visible output tokens and reasoning tokens. final ResponsesClientEvent.BuildermaxOutputTokens(Long maxOutputTokens)Alias for Builder.maxOutputTokens. final ResponsesClientEvent.BuildermaxOutputTokens(Optional<Long> maxOutputTokens)Alias for calling Builder.maxOutputTokens with maxOutputTokens.orElse(null).final ResponsesClientEvent.BuildermaxOutputTokens(JsonField<Long> maxOutputTokens)Sets Builder.maxOutputTokens to an arbitrary JSON value. final ResponsesClientEvent.BuildermaxToolCalls(Long maxToolCalls)The maximum number of total calls to built-in tools that can be processed in a response. final ResponsesClientEvent.BuildermaxToolCalls(Long maxToolCalls)Alias for Builder.maxToolCalls. final ResponsesClientEvent.BuildermaxToolCalls(Optional<Long> maxToolCalls)Alias for calling Builder.maxToolCalls with maxToolCalls.orElse(null).final ResponsesClientEvent.BuildermaxToolCalls(JsonField<Long> maxToolCalls)Sets Builder.maxToolCalls to an arbitrary JSON value. final ResponsesClientEvent.Buildermetadata(ResponsesClientEvent.Metadata metadata)Set of 16 key-value pairs that can be attached to an object. final ResponsesClientEvent.Buildermetadata(Optional<ResponsesClientEvent.Metadata> metadata)Alias for calling Builder.metadata with metadata.orElse(null).final ResponsesClientEvent.Buildermetadata(JsonField<ResponsesClientEvent.Metadata> metadata)Sets Builder.metadata to an arbitrary JSON value. final ResponsesClientEvent.Buildermodel(ResponsesModel model)Model ID used to generate the response, like gpt-4ooro3.final ResponsesClientEvent.Buildermodel(JsonField<ResponsesModel> model)Sets Builder.model to an arbitrary JSON value. final ResponsesClientEvent.Buildermodel(String string)Alias for calling model with ResponsesModel.ofString(string).final ResponsesClientEvent.Buildermodel(ChatModel chat)Alias for calling model with ResponsesModel.ofChat(chat).final ResponsesClientEvent.Buildermodel(ResponsesModel.ResponsesOnlyModel only)Alias for calling model with ResponsesModel.ofOnly(only).final ResponsesClientEvent.BuilderparallelToolCalls(Boolean parallelToolCalls)Whether to allow the model to run tool calls in parallel. final ResponsesClientEvent.BuilderparallelToolCalls(Boolean parallelToolCalls)Alias for Builder.parallelToolCalls. final ResponsesClientEvent.BuilderparallelToolCalls(Optional<Boolean> parallelToolCalls)Alias for calling Builder.parallelToolCalls with parallelToolCalls.orElse(null).final ResponsesClientEvent.BuilderparallelToolCalls(JsonField<Boolean> parallelToolCalls)Sets Builder.parallelToolCalls to an arbitrary JSON value. final ResponsesClientEvent.BuilderpreviousResponseId(String previousResponseId)The unique ID of the previous response to the model. final ResponsesClientEvent.BuilderpreviousResponseId(Optional<String> previousResponseId)Alias for calling Builder.previousResponseId with previousResponseId.orElse(null).final ResponsesClientEvent.BuilderpreviousResponseId(JsonField<String> previousResponseId)Sets Builder.previousResponseId to an arbitrary JSON value. final ResponsesClientEvent.Builderprompt(ResponsePrompt prompt)Reference to a prompt template and its variables. final ResponsesClientEvent.Builderprompt(Optional<ResponsePrompt> prompt)Alias for calling Builder.prompt with prompt.orElse(null).final ResponsesClientEvent.Builderprompt(JsonField<ResponsePrompt> prompt)Sets Builder.prompt to an arbitrary JSON value. final ResponsesClientEvent.BuilderpromptCacheKey(String promptCacheKey)Used by OpenAI to cache responses for similar requests to optimize your cache hit rates. final ResponsesClientEvent.BuilderpromptCacheKey(JsonField<String> promptCacheKey)Sets Builder.promptCacheKey to an arbitrary JSON value. final ResponsesClientEvent.BuilderpromptCacheRetention(ResponsesClientEvent.PromptCacheRetention promptCacheRetention)The retention policy for the prompt cache. final ResponsesClientEvent.BuilderpromptCacheRetention(Optional<ResponsesClientEvent.PromptCacheRetention> promptCacheRetention)Alias for calling Builder.promptCacheRetention with promptCacheRetention.orElse(null).final ResponsesClientEvent.BuilderpromptCacheRetention(JsonField<ResponsesClientEvent.PromptCacheRetention> promptCacheRetention)Sets Builder.promptCacheRetention to an arbitrary JSON value. final ResponsesClientEvent.Builderreasoning(Reasoning reasoning)gpt-5 and o-series models onlyConfiguration options for reasoning models. final ResponsesClientEvent.Builderreasoning(Optional<Reasoning> reasoning)Alias for calling Builder.reasoning with reasoning.orElse(null).final ResponsesClientEvent.Builderreasoning(JsonField<Reasoning> reasoning)Sets Builder.reasoning to an arbitrary JSON value. final ResponsesClientEvent.BuildersafetyIdentifier(String safetyIdentifier)A stable identifier used to help detect users of your application that may be violating OpenAI's usage policies. final ResponsesClientEvent.BuildersafetyIdentifier(JsonField<String> safetyIdentifier)Sets Builder.safetyIdentifier to an arbitrary JSON value. final ResponsesClientEvent.BuilderserviceTier(ResponsesClientEvent.ServiceTier serviceTier)Specifies the processing type used for serving the request. final ResponsesClientEvent.BuilderserviceTier(Optional<ResponsesClientEvent.ServiceTier> serviceTier)Alias for calling Builder.serviceTier with serviceTier.orElse(null).final ResponsesClientEvent.BuilderserviceTier(JsonField<ResponsesClientEvent.ServiceTier> serviceTier)Sets Builder.serviceTier to an arbitrary JSON value. final ResponsesClientEvent.Builderstore(Boolean store)Whether to store the generated model response for later retrieval via API. final ResponsesClientEvent.Builderstore(Boolean store)Alias for Builder.store. final ResponsesClientEvent.Builderstore(Optional<Boolean> store)Alias for calling Builder.store with store.orElse(null).final ResponsesClientEvent.Builderstore(JsonField<Boolean> store)Sets Builder.store to an arbitrary JSON value. final ResponsesClientEvent.Builderstream(Boolean stream)If set to true, the model response data will be streamed to the client as it is generated using server-sent events. final ResponsesClientEvent.Builderstream(Boolean stream)Alias for Builder.stream. final ResponsesClientEvent.Builderstream(Optional<Boolean> stream)Alias for calling Builder.stream with stream.orElse(null).final ResponsesClientEvent.Builderstream(JsonField<Boolean> stream)Sets Builder.stream to an arbitrary JSON value. final ResponsesClientEvent.BuilderstreamOptions(ResponsesClientEvent.StreamOptions streamOptions)Options for streaming responses. final ResponsesClientEvent.BuilderstreamOptions(Optional<ResponsesClientEvent.StreamOptions> streamOptions)Alias for calling Builder.streamOptions with streamOptions.orElse(null).final ResponsesClientEvent.BuilderstreamOptions(JsonField<ResponsesClientEvent.StreamOptions> streamOptions)Sets Builder.streamOptions to an arbitrary JSON value. final ResponsesClientEvent.Buildertemperature(Double temperature)What sampling temperature to use, between 0 and 2. final ResponsesClientEvent.Buildertemperature(Double temperature)Alias for Builder.temperature. final ResponsesClientEvent.Buildertemperature(Optional<Double> temperature)Alias for calling Builder.temperature with temperature.orElse(null).final ResponsesClientEvent.Buildertemperature(JsonField<Double> temperature)Sets Builder.temperature to an arbitrary JSON value. final ResponsesClientEvent.Buildertext(ResponseTextConfig text)Configuration options for a text response from the model. final ResponsesClientEvent.Buildertext(JsonField<ResponseTextConfig> text)Sets Builder.text to an arbitrary JSON value. final ResponsesClientEvent.BuildertoolChoice(ResponsesClientEvent.ToolChoice toolChoice)How the model should select which tool (or tools) to use when generating a response. final ResponsesClientEvent.BuildertoolChoice(JsonField<ResponsesClientEvent.ToolChoice> toolChoice)Sets Builder.toolChoice to an arbitrary JSON value. final ResponsesClientEvent.BuildertoolChoice(ToolChoiceOptions options)Alias for calling toolChoice with ToolChoice.ofOptions(options).final ResponsesClientEvent.BuildertoolChoice(ToolChoiceAllowed allowed)Alias for calling toolChoice with ToolChoice.ofAllowed(allowed).final ResponsesClientEvent.BuildertoolChoice(ToolChoiceTypes types)Alias for calling toolChoice with ToolChoice.ofTypes(types).final ResponsesClientEvent.BuildertoolChoice(ToolChoiceFunction function)Alias for calling toolChoice with ToolChoice.ofFunction(function).final ResponsesClientEvent.BuildertoolChoice(ToolChoiceMcp mcp)Alias for calling toolChoice with ToolChoice.ofMcp(mcp).final ResponsesClientEvent.BuildertoolChoice(ToolChoiceCustom custom)Alias for calling toolChoice with ToolChoice.ofCustom(custom).final ResponsesClientEvent.BuildertoolChoice(ToolChoiceApplyPatch applyPatch)Alias for calling toolChoice with ToolChoice.ofApplyPatch(applyPatch).final ResponsesClientEvent.BuildertoolChoice(ToolChoiceShell shell)Alias for calling toolChoice with ToolChoice.ofShell(shell).final ResponsesClientEvent.Buildertools(List<Tool> tools)An array of tools the model may call while generating a response. final ResponsesClientEvent.Buildertools(JsonField<List<Tool>> tools)Sets Builder.tools to an arbitrary JSON value. final ResponsesClientEvent.BuilderaddTool(Tool tool)Adds a single Tool to tools. final ResponsesClientEvent.BuilderaddTool(FunctionTool function)Alias for calling addTool with Tool.ofFunction(function).final ResponsesClientEvent.BuilderaddTool(FileSearchTool fileSearch)Alias for calling addTool with Tool.ofFileSearch(fileSearch).final ResponsesClientEvent.BuilderaddTool(ComputerTool computerUsePreview)Alias for calling addTool with Tool.ofComputerUsePreview(computerUsePreview).final ResponsesClientEvent.BuilderaddTool(WebSearchTool webSearch)Alias for calling addTool with Tool.ofWebSearch(webSearch).final ResponsesClientEvent.BuilderaddTool(Tool.Mcp mcp)Alias for calling addTool with Tool.ofMcp(mcp).final ResponsesClientEvent.BuilderaddTool(Tool.CodeInterpreter codeInterpreter)Alias for calling addTool with Tool.ofCodeInterpreter(codeInterpreter).final ResponsesClientEvent.BuilderaddTool(Tool.ImageGeneration imageGeneration)Alias for calling addTool with Tool.ofImageGeneration(imageGeneration).final ResponsesClientEvent.BuilderaddTool(FunctionShellTool shell)Alias for calling addTool with Tool.ofShell(shell).final ResponsesClientEvent.BuilderaddTool(CustomTool custom)Alias for calling addTool with Tool.ofCustom(custom).final ResponsesClientEvent.BuilderaddTool(WebSearchPreviewTool webSearchPreview)Alias for calling addTool with Tool.ofWebSearchPreview(webSearchPreview).final ResponsesClientEvent.BuilderaddTool(ApplyPatchTool applyPatch)Alias for calling addTool with Tool.ofApplyPatch(applyPatch).final ResponsesClientEvent.BuilderaddFileSearchTool(List<String> vectorStoreIds)Alias for calling addTool with the following: FileSearchTool.builder() .vectorStoreIds(vectorStoreIds) .build()final ResponsesClientEvent.BuilderaddMcpTool(String serverLabel)Alias for calling addTool with the following: Tool.Mcp.builder() .serverLabel(serverLabel) .build()final ResponsesClientEvent.BuilderaddCodeInterpreterTool(Tool.CodeInterpreter.Container container)Alias for calling addTool with the following: Tool.CodeInterpreter.builder() .container(container) .build()final ResponsesClientEvent.BuilderaddCodeInterpreterTool(String string)Alias for calling addCodeInterpreterTool with Tool.CodeInterpreter.Container.ofString(string).final ResponsesClientEvent.BuilderaddCodeInterpreterTool(Tool.CodeInterpreter.Container.CodeInterpreterToolAuto codeInterpreterToolAuto)Alias for calling addCodeInterpreterTool with Tool.CodeInterpreter.Container.ofCodeInterpreterToolAuto(codeInterpreterToolAuto).final ResponsesClientEvent.BuilderaddToolLocalShell()Alias for calling addTool with Tool.ofLocalShell().final ResponsesClientEvent.BuilderaddCustomTool(String name)Alias for calling addTool with the following: CustomTool.builder() .name(name) .build()final ResponsesClientEvent.BuildertopLogprobs(Long topLogprobs)An integer between 0 and 20 specifying the number of most likely tokens to return at each token position, each with an associated log probability. final ResponsesClientEvent.BuildertopLogprobs(Long topLogprobs)Alias for Builder.topLogprobs. final ResponsesClientEvent.BuildertopLogprobs(Optional<Long> topLogprobs)Alias for calling Builder.topLogprobs with topLogprobs.orElse(null).final ResponsesClientEvent.BuildertopLogprobs(JsonField<Long> topLogprobs)Sets Builder.topLogprobs to an arbitrary JSON value. final ResponsesClientEvent.BuildertopP(Double topP)An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. final ResponsesClientEvent.BuildertopP(Double topP)Alias for Builder.topP. final ResponsesClientEvent.BuildertopP(Optional<Double> topP)Alias for calling Builder.topP with topP.orElse(null).final ResponsesClientEvent.BuildertopP(JsonField<Double> topP)Sets Builder.topP to an arbitrary JSON value. final ResponsesClientEvent.Buildertruncation(ResponsesClientEvent.Truncation truncation)The truncation strategy to use for the model response. final ResponsesClientEvent.Buildertruncation(Optional<ResponsesClientEvent.Truncation> truncation)Alias for calling Builder.truncation with truncation.orElse(null).final ResponsesClientEvent.Buildertruncation(JsonField<ResponsesClientEvent.Truncation> truncation)Sets Builder.truncation to an arbitrary JSON value. final ResponsesClientEvent.Builderuser(String user)This field is being replaced by safety_identifierandprompt_cache_key.final ResponsesClientEvent.Builderuser(JsonField<String> user)Sets Builder.user to an arbitrary JSON value. final ResponsesClientEvent.BuilderadditionalProperties(Map<String, JsonValue> additionalProperties)final ResponsesClientEvent.BuilderputAdditionalProperty(String key, JsonValue value)final ResponsesClientEvent.BuilderputAllAdditionalProperties(Map<String, JsonValue> additionalProperties)final ResponsesClientEvent.BuilderremoveAdditionalProperty(String key)final ResponsesClientEvent.BuilderremoveAllAdditionalProperties(Set<String> keys)final ResponsesClientEventbuild()Returns an immutable instance of ResponsesClientEvent. -
-
Method Detail
-
type
final ResponsesClientEvent.Builder type(JsonValue type)
Sets the field to an arbitrary JSON value.
It is usually unnecessary to call this method because the field defaults to the following:
JsonValue.from("response.create")This method is primarily for setting the field to an undocumented or not yet supported value.
-
background
final ResponsesClientEvent.Builder background(Boolean background)
Whether to run the model response in the background. Learn more.
-
background
final ResponsesClientEvent.Builder background(Boolean background)
Alias for Builder.background.
This unboxed primitive overload exists for backwards compatibility.
-
background
final ResponsesClientEvent.Builder background(Optional<Boolean> background)
Alias for calling Builder.background with
background.orElse(null).
-
background
final ResponsesClientEvent.Builder background(JsonField<Boolean> background)
Sets Builder.background to an arbitrary JSON value.
You should usually call Builder.background with a well-typed Boolean value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
contextManagement
final ResponsesClientEvent.Builder contextManagement(List<ResponsesClientEvent.ContextManagement> contextManagement)
Context management configuration for this request.
-
contextManagement
final ResponsesClientEvent.Builder contextManagement(Optional<List<ResponsesClientEvent.ContextManagement>> contextManagement)
Alias for calling Builder.contextManagement with
contextManagement.orElse(null).
-
contextManagement
final ResponsesClientEvent.Builder contextManagement(JsonField<List<ResponsesClientEvent.ContextManagement>> contextManagement)
Sets Builder.contextManagement to an arbitrary JSON value.
You should usually call Builder.contextManagement with a well-typed
List<ContextManagement>value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
addContextManagement
final ResponsesClientEvent.Builder addContextManagement(ResponsesClientEvent.ContextManagement contextManagement)
Adds a single ContextManagement to Builder.contextManagement.
-
conversation
final ResponsesClientEvent.Builder conversation(ResponsesClientEvent.Conversation conversation)
The conversation that this response belongs to. Items from this conversation are prepended to
input_itemsfor this response request. Input items and output items from this response are automatically added to this conversation after this response completes.
-
conversation
final ResponsesClientEvent.Builder conversation(Optional<ResponsesClientEvent.Conversation> conversation)
Alias for calling Builder.conversation with
conversation.orElse(null).
-
conversation
final ResponsesClientEvent.Builder conversation(JsonField<ResponsesClientEvent.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 ResponsesClientEvent.Builder conversation(String id)
Alias for calling conversation with
Conversation.ofId(id).
-
conversation
final ResponsesClientEvent.Builder conversation(ResponseConversationParam responseConversationParam)
Alias for calling conversation with
Conversation.ofResponseConversationParam(responseConversationParam).
-
include
final ResponsesClientEvent.Builder include(List<ResponseIncludable> include)
Specify additional output data to include in the model response. Currently supported values are:
web_search_call.action.sources: Include the sources of the web search tool call.code_interpreter_call.outputs: Includes the outputs of python code execution in code interpreter tool call items.computer_call_output.output.image_url: Include image urls from the computer call output.file_search_call.results: Include the search results of the file search tool call.message.input_image.image_url: Include image urls from the input message.message.output_text.logprobs: Include logprobs with assistant messages.reasoning.encrypted_content: Includes an encrypted version of reasoning tokens in reasoning item outputs. This enables reasoning items to be used in multi-turn conversations when using the Responses API statelessly (like when thestoreparameter is set tofalse, or when an organization is enrolled in the zero data retention program).
-
include
final ResponsesClientEvent.Builder include(Optional<List<ResponseIncludable>> include)
Alias for calling Builder.include with
include.orElse(null).
-
include
final ResponsesClientEvent.Builder include(JsonField<List<ResponseIncludable>> include)
Sets Builder.include to an arbitrary JSON value.
You should usually call Builder.include with a well-typed
List<ResponseIncludable>value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
addInclude
final ResponsesClientEvent.Builder addInclude(ResponseIncludable include)
Adds a single ResponseIncludable to Builder.include.
-
input
final ResponsesClientEvent.Builder input(ResponsesClientEvent.Input input)
Text, image, or file inputs to the model, used to generate a response.
Learn more:
-
input
final ResponsesClientEvent.Builder input(JsonField<ResponsesClientEvent.Input> input)
Sets Builder.input to an arbitrary JSON value.
You should usually call Builder.input with a well-typed Input value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
input
final ResponsesClientEvent.Builder input(String text)
Alias for calling input with
Input.ofText(text).
-
inputOfResponse
final ResponsesClientEvent.Builder inputOfResponse(List<ResponseInputItem> response)
Alias for calling input with
Input.ofResponse(response).
-
instructions
final ResponsesClientEvent.Builder instructions(String instructions)
A system (or developer) message inserted into the model's context.
When using along with
previous_response_id, the instructions from a previous response will not be carried over to the next response. This makes it simple to swap out system (or developer) messages in new responses.
-
instructions
final ResponsesClientEvent.Builder instructions(Optional<String> instructions)
Alias for calling Builder.instructions with
instructions.orElse(null).
-
instructions
final ResponsesClientEvent.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 ResponsesClientEvent.Builder maxOutputTokens(Long maxOutputTokens)
An upper bound for the number of tokens that can be generated for a response, including visible output tokens and reasoning tokens.
-
maxOutputTokens
final ResponsesClientEvent.Builder maxOutputTokens(Long maxOutputTokens)
Alias for Builder.maxOutputTokens.
This unboxed primitive overload exists for backwards compatibility.
-
maxOutputTokens
final ResponsesClientEvent.Builder maxOutputTokens(Optional<Long> maxOutputTokens)
Alias for calling Builder.maxOutputTokens with
maxOutputTokens.orElse(null).
-
maxOutputTokens
final ResponsesClientEvent.Builder maxOutputTokens(JsonField<Long> maxOutputTokens)
Sets Builder.maxOutputTokens to an arbitrary JSON value.
You should usually call Builder.maxOutputTokens with a well-typed Long value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
maxToolCalls
final ResponsesClientEvent.Builder maxToolCalls(Long maxToolCalls)
The maximum number of total calls to built-in tools that can be processed in a response. This maximum number applies across all built-in tool calls, not per individual tool. Any further attempts to call a tool by the model will be ignored.
-
maxToolCalls
final ResponsesClientEvent.Builder maxToolCalls(Long maxToolCalls)
Alias for Builder.maxToolCalls.
This unboxed primitive overload exists for backwards compatibility.
-
maxToolCalls
final ResponsesClientEvent.Builder maxToolCalls(Optional<Long> maxToolCalls)
Alias for calling Builder.maxToolCalls with
maxToolCalls.orElse(null).
-
maxToolCalls
final ResponsesClientEvent.Builder maxToolCalls(JsonField<Long> maxToolCalls)
Sets Builder.maxToolCalls to an arbitrary JSON value.
You should usually call Builder.maxToolCalls with a well-typed Long value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
metadata
final ResponsesClientEvent.Builder metadata(ResponsesClientEvent.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 ResponsesClientEvent.Builder metadata(Optional<ResponsesClientEvent.Metadata> metadata)
Alias for calling Builder.metadata with
metadata.orElse(null).
-
metadata
final ResponsesClientEvent.Builder metadata(JsonField<ResponsesClientEvent.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.
-
model
final ResponsesClientEvent.Builder model(ResponsesModel model)
Model ID used to generate the response, like
gpt-4ooro3. OpenAI offers a wide range of models with different capabilities, performance characteristics, and price points. Refer to the model guide to browse and compare available models.
-
model
final ResponsesClientEvent.Builder model(JsonField<ResponsesModel> model)
Sets Builder.model to an arbitrary JSON value.
You should usually call Builder.model with a well-typed ResponsesModel value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
model
final ResponsesClientEvent.Builder model(String string)
Alias for calling model with
ResponsesModel.ofString(string).
-
model
final ResponsesClientEvent.Builder model(ChatModel chat)
Alias for calling model with
ResponsesModel.ofChat(chat).
-
model
final ResponsesClientEvent.Builder model(ResponsesModel.ResponsesOnlyModel only)
Alias for calling model with
ResponsesModel.ofOnly(only).
-
parallelToolCalls
final ResponsesClientEvent.Builder parallelToolCalls(Boolean parallelToolCalls)
Whether to allow the model to run tool calls in parallel.
-
parallelToolCalls
final ResponsesClientEvent.Builder parallelToolCalls(Boolean parallelToolCalls)
Alias for Builder.parallelToolCalls.
This unboxed primitive overload exists for backwards compatibility.
-
parallelToolCalls
final ResponsesClientEvent.Builder parallelToolCalls(Optional<Boolean> parallelToolCalls)
Alias for calling Builder.parallelToolCalls with
parallelToolCalls.orElse(null).
-
parallelToolCalls
final ResponsesClientEvent.Builder parallelToolCalls(JsonField<Boolean> parallelToolCalls)
Sets Builder.parallelToolCalls to an arbitrary JSON value.
You should usually call Builder.parallelToolCalls with a well-typed Boolean value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
previousResponseId
final ResponsesClientEvent.Builder previousResponseId(String previousResponseId)
The unique ID of the previous response to the model. Use this to create multi-turn conversations. Learn more about conversation state. Cannot be used in conjunction with
conversation.
-
previousResponseId
final ResponsesClientEvent.Builder previousResponseId(Optional<String> previousResponseId)
Alias for calling Builder.previousResponseId with
previousResponseId.orElse(null).
-
previousResponseId
final ResponsesClientEvent.Builder previousResponseId(JsonField<String> previousResponseId)
Sets Builder.previousResponseId to an arbitrary JSON value.
You should usually call Builder.previousResponseId with a well-typed String value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
prompt
final ResponsesClientEvent.Builder prompt(ResponsePrompt prompt)
Reference to a prompt template and its variables. Learn more.
-
prompt
final ResponsesClientEvent.Builder prompt(Optional<ResponsePrompt> prompt)
Alias for calling Builder.prompt with
prompt.orElse(null).
-
prompt
final ResponsesClientEvent.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.
-
promptCacheKey
final ResponsesClientEvent.Builder promptCacheKey(String promptCacheKey)
Used by OpenAI to cache responses for similar requests to optimize your cache hit rates. Replaces the
userfield. Learn more.
-
promptCacheKey
final ResponsesClientEvent.Builder promptCacheKey(JsonField<String> promptCacheKey)
Sets Builder.promptCacheKey to an arbitrary JSON value.
You should usually call Builder.promptCacheKey with a well-typed String value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
promptCacheRetention
final ResponsesClientEvent.Builder promptCacheRetention(ResponsesClientEvent.PromptCacheRetention promptCacheRetention)
The retention policy for the prompt cache. Set to
24hto enable extended prompt caching, which keeps cached prefixes active for longer, up to a maximum of 24 hours. Learn more.
-
promptCacheRetention
final ResponsesClientEvent.Builder promptCacheRetention(Optional<ResponsesClientEvent.PromptCacheRetention> promptCacheRetention)
Alias for calling Builder.promptCacheRetention with
promptCacheRetention.orElse(null).
-
promptCacheRetention
final ResponsesClientEvent.Builder promptCacheRetention(JsonField<ResponsesClientEvent.PromptCacheRetention> promptCacheRetention)
Sets Builder.promptCacheRetention to an arbitrary JSON value.
You should usually call Builder.promptCacheRetention with a well-typed PromptCacheRetention value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
reasoning
final ResponsesClientEvent.Builder reasoning(Reasoning reasoning)
gpt-5 and o-series models only
Configuration options for reasoning models.
-
reasoning
final ResponsesClientEvent.Builder reasoning(Optional<Reasoning> reasoning)
Alias for calling Builder.reasoning with
reasoning.orElse(null).
-
reasoning
final ResponsesClientEvent.Builder reasoning(JsonField<Reasoning> reasoning)
Sets Builder.reasoning to an arbitrary JSON value.
You should usually call Builder.reasoning with a well-typed Reasoning value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
safetyIdentifier
final ResponsesClientEvent.Builder safetyIdentifier(String safetyIdentifier)
A stable identifier used to help detect users of your application that may be violating OpenAI's usage policies. The IDs should be a string that uniquely identifies each user, with a maximum length of 64 characters. We recommend hashing their username or email address, in order to avoid sending us any identifying information. Learn more.
-
safetyIdentifier
final ResponsesClientEvent.Builder safetyIdentifier(JsonField<String> safetyIdentifier)
Sets Builder.safetyIdentifier to an arbitrary JSON value.
You should usually call Builder.safetyIdentifier with a well-typed String value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
serviceTier
final ResponsesClientEvent.Builder serviceTier(ResponsesClientEvent.ServiceTier serviceTier)
Specifies the processing type used for serving the request.
If set to 'auto', then the request will be processed with the service tier configured in the Project settings. Unless otherwise configured, the Project will use 'default'.
If set to 'default', then the request will be processed with the standard pricing and performance for the selected model.
If set to 'flex' or 'priority', then the request will be processed with the corresponding service tier.
When not set, the default behavior is 'auto'.
When the
service_tierparameter is set, the response body will include theservice_tiervalue based on the processing mode actually used to serve the request. This response value may be different from the value set in the parameter.
-
serviceTier
final ResponsesClientEvent.Builder serviceTier(Optional<ResponsesClientEvent.ServiceTier> serviceTier)
Alias for calling Builder.serviceTier with
serviceTier.orElse(null).
-
serviceTier
final ResponsesClientEvent.Builder serviceTier(JsonField<ResponsesClientEvent.ServiceTier> serviceTier)
Sets Builder.serviceTier to an arbitrary JSON value.
You should usually call Builder.serviceTier with a well-typed ServiceTier value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
store
final ResponsesClientEvent.Builder store(Boolean store)
Whether to store the generated model response for later retrieval via API.
-
store
final ResponsesClientEvent.Builder store(Boolean store)
Alias for Builder.store.
This unboxed primitive overload exists for backwards compatibility.
-
store
final ResponsesClientEvent.Builder store(Optional<Boolean> store)
Alias for calling Builder.store with
store.orElse(null).
-
store
final ResponsesClientEvent.Builder store(JsonField<Boolean> store)
Sets Builder.store to an arbitrary JSON value.
You should usually call Builder.store with a well-typed Boolean value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
stream
final ResponsesClientEvent.Builder stream(Boolean stream)
If set to true, the model response data will be streamed to the client as it is generated using server-sent events. See the Streaming section below for more information.
-
stream
final ResponsesClientEvent.Builder stream(Boolean stream)
Alias for Builder.stream.
This unboxed primitive overload exists for backwards compatibility.
-
stream
final ResponsesClientEvent.Builder stream(Optional<Boolean> stream)
Alias for calling Builder.stream with
stream.orElse(null).
-
stream
final ResponsesClientEvent.Builder stream(JsonField<Boolean> stream)
Sets Builder.stream to an arbitrary JSON value.
You should usually call Builder.stream with a well-typed Boolean value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
streamOptions
final ResponsesClientEvent.Builder streamOptions(ResponsesClientEvent.StreamOptions streamOptions)
Options for streaming responses. Only set this when you set
stream: true.
-
streamOptions
final ResponsesClientEvent.Builder streamOptions(Optional<ResponsesClientEvent.StreamOptions> streamOptions)
Alias for calling Builder.streamOptions with
streamOptions.orElse(null).
-
streamOptions
final ResponsesClientEvent.Builder streamOptions(JsonField<ResponsesClientEvent.StreamOptions> streamOptions)
Sets Builder.streamOptions to an arbitrary JSON value.
You should usually call Builder.streamOptions with a well-typed StreamOptions value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
temperature
final ResponsesClientEvent.Builder temperature(Double temperature)
What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or
top_pbut not both.
-
temperature
final ResponsesClientEvent.Builder temperature(Double temperature)
Alias for Builder.temperature.
This unboxed primitive overload exists for backwards compatibility.
-
temperature
final ResponsesClientEvent.Builder temperature(Optional<Double> temperature)
Alias for calling Builder.temperature with
temperature.orElse(null).
-
temperature
final ResponsesClientEvent.Builder temperature(JsonField<Double> temperature)
Sets Builder.temperature to an arbitrary JSON value.
You should usually call Builder.temperature with a well-typed Double value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
text
final ResponsesClientEvent.Builder text(ResponseTextConfig text)
Configuration options for a text response from the model. Can be plain text or structured JSON data. Learn more:
-
text
final ResponsesClientEvent.Builder text(JsonField<ResponseTextConfig> text)
Sets Builder.text to an arbitrary JSON value.
You should usually call Builder.text with a well-typed ResponseTextConfig value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
toolChoice
final ResponsesClientEvent.Builder toolChoice(ResponsesClientEvent.ToolChoice toolChoice)
How the model should select which tool (or tools) to use when generating a response. See the
toolsparameter to see how to specify which tools the model can call.
-
toolChoice
final ResponsesClientEvent.Builder toolChoice(JsonField<ResponsesClientEvent.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 ResponsesClientEvent.Builder toolChoice(ToolChoiceOptions options)
Alias for calling toolChoice with
ToolChoice.ofOptions(options).
-
toolChoice
final ResponsesClientEvent.Builder toolChoice(ToolChoiceAllowed allowed)
Alias for calling toolChoice with
ToolChoice.ofAllowed(allowed).
-
toolChoice
final ResponsesClientEvent.Builder toolChoice(ToolChoiceTypes types)
Alias for calling toolChoice with
ToolChoice.ofTypes(types).
-
toolChoice
final ResponsesClientEvent.Builder toolChoice(ToolChoiceFunction function)
Alias for calling toolChoice with
ToolChoice.ofFunction(function).
-
toolChoice
final ResponsesClientEvent.Builder toolChoice(ToolChoiceMcp mcp)
Alias for calling toolChoice with
ToolChoice.ofMcp(mcp).
-
toolChoice
final ResponsesClientEvent.Builder toolChoice(ToolChoiceCustom custom)
Alias for calling toolChoice with
ToolChoice.ofCustom(custom).
-
toolChoice
final ResponsesClientEvent.Builder toolChoice(ToolChoiceApplyPatch applyPatch)
Alias for calling toolChoice with
ToolChoice.ofApplyPatch(applyPatch).
-
toolChoice
final ResponsesClientEvent.Builder toolChoice(ToolChoiceShell shell)
Alias for calling toolChoice with
ToolChoice.ofShell(shell).
-
tools
final ResponsesClientEvent.Builder tools(List<Tool> tools)
An array of tools the model may call while generating a response. You can specify which tool to use by setting the
tool_choiceparameter.We support the following categories of tools:
Built-in tools: Tools that are provided by OpenAI that extend the model's capabilities, like web search or file search. Learn more about built-in tools.
MCP Tools: Integrations with third-party systems via custom MCP servers or predefined connectors such as Google Drive and SharePoint. Learn more about MCP Tools.
Function calls (custom tools): Functions that are defined by you, enabling the model to call your own code with strongly typed arguments and outputs. Learn more about function calling. You can also use custom tools to call your own code.
-
tools
final ResponsesClientEvent.Builder tools(JsonField<List<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 ResponsesClientEvent.Builder addTool(Tool tool)
-
addTool
final ResponsesClientEvent.Builder addTool(FunctionTool function)
Alias for calling addTool with
Tool.ofFunction(function).
-
addTool
final ResponsesClientEvent.Builder addTool(FileSearchTool fileSearch)
Alias for calling addTool with
Tool.ofFileSearch(fileSearch).
-
addTool
final ResponsesClientEvent.Builder addTool(ComputerTool computerUsePreview)
Alias for calling addTool with
Tool.ofComputerUsePreview(computerUsePreview).
-
addTool
final ResponsesClientEvent.Builder addTool(WebSearchTool webSearch)
Alias for calling addTool with
Tool.ofWebSearch(webSearch).
-
addTool
final ResponsesClientEvent.Builder addTool(Tool.Mcp mcp)
Alias for calling addTool with
Tool.ofMcp(mcp).
-
addTool
final ResponsesClientEvent.Builder addTool(Tool.CodeInterpreter codeInterpreter)
Alias for calling addTool with
Tool.ofCodeInterpreter(codeInterpreter).
-
addTool
final ResponsesClientEvent.Builder addTool(Tool.ImageGeneration imageGeneration)
Alias for calling addTool with
Tool.ofImageGeneration(imageGeneration).
-
addTool
final ResponsesClientEvent.Builder addTool(FunctionShellTool shell)
Alias for calling addTool with
Tool.ofShell(shell).
-
addTool
final ResponsesClientEvent.Builder addTool(CustomTool custom)
Alias for calling addTool with
Tool.ofCustom(custom).
-
addTool
final ResponsesClientEvent.Builder addTool(WebSearchPreviewTool webSearchPreview)
Alias for calling addTool with
Tool.ofWebSearchPreview(webSearchPreview).
-
addTool
final ResponsesClientEvent.Builder addTool(ApplyPatchTool applyPatch)
Alias for calling addTool with
Tool.ofApplyPatch(applyPatch).
-
addFileSearchTool
final ResponsesClientEvent.Builder addFileSearchTool(List<String> vectorStoreIds)
Alias for calling addTool with the following:
FileSearchTool.builder() .vectorStoreIds(vectorStoreIds) .build()
-
addMcpTool
final ResponsesClientEvent.Builder addMcpTool(String serverLabel)
Alias for calling addTool with the following:
Tool.Mcp.builder() .serverLabel(serverLabel) .build()
-
addCodeInterpreterTool
final ResponsesClientEvent.Builder addCodeInterpreterTool(Tool.CodeInterpreter.Container container)
Alias for calling addTool with the following:
Tool.CodeInterpreter.builder() .container(container) .build()
-
addCodeInterpreterTool
final ResponsesClientEvent.Builder addCodeInterpreterTool(String string)
Alias for calling addCodeInterpreterTool with
Tool.CodeInterpreter.Container.ofString(string).
-
addCodeInterpreterTool
final ResponsesClientEvent.Builder addCodeInterpreterTool(Tool.CodeInterpreter.Container.CodeInterpreterToolAuto codeInterpreterToolAuto)
Alias for calling addCodeInterpreterTool with
Tool.CodeInterpreter.Container.ofCodeInterpreterToolAuto(codeInterpreterToolAuto).
-
addToolLocalShell
final ResponsesClientEvent.Builder addToolLocalShell()
Alias for calling addTool with
Tool.ofLocalShell().
-
addCustomTool
final ResponsesClientEvent.Builder addCustomTool(String name)
Alias for calling addTool with the following:
CustomTool.builder() .name(name) .build()
-
topLogprobs
final ResponsesClientEvent.Builder topLogprobs(Long topLogprobs)
An integer between 0 and 20 specifying the number of most likely tokens to return at each token position, each with an associated log probability.
-
topLogprobs
final ResponsesClientEvent.Builder topLogprobs(Long topLogprobs)
Alias for Builder.topLogprobs.
This unboxed primitive overload exists for backwards compatibility.
-
topLogprobs
final ResponsesClientEvent.Builder topLogprobs(Optional<Long> topLogprobs)
Alias for calling Builder.topLogprobs with
topLogprobs.orElse(null).
-
topLogprobs
final ResponsesClientEvent.Builder topLogprobs(JsonField<Long> topLogprobs)
Sets Builder.topLogprobs to an arbitrary JSON value.
You should usually call Builder.topLogprobs with a well-typed Long value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
topP
final ResponsesClientEvent.Builder topP(Double topP)
An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered.
We generally recommend altering this or
temperaturebut not both.
-
topP
final ResponsesClientEvent.Builder topP(Double topP)
Alias for Builder.topP.
This unboxed primitive overload exists for backwards compatibility.
-
topP
final ResponsesClientEvent.Builder topP(Optional<Double> topP)
Alias for calling Builder.topP with
topP.orElse(null).
-
topP
final ResponsesClientEvent.Builder topP(JsonField<Double> topP)
Sets Builder.topP to an arbitrary JSON value.
You should usually call Builder.topP with a well-typed Double value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
truncation
final ResponsesClientEvent.Builder truncation(ResponsesClientEvent.Truncation truncation)
The truncation strategy to use for the model response.
auto: If the input to this Response exceeds the model's context window size, the model will truncate the response to fit the context window by dropping items from the beginning of the conversation.disabled(default): If the input size will exceed the context window size for a model, the request will fail with a 400 error.
-
truncation
final ResponsesClientEvent.Builder truncation(Optional<ResponsesClientEvent.Truncation> truncation)
Alias for calling Builder.truncation with
truncation.orElse(null).
-
truncation
final ResponsesClientEvent.Builder truncation(JsonField<ResponsesClientEvent.Truncation> truncation)
Sets Builder.truncation to an arbitrary JSON value.
You should usually call Builder.truncation with a well-typed Truncation value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
user
@Deprecated(message = "deprecated") final ResponsesClientEvent.Builder user(String user)
This field is being replaced by
safety_identifierandprompt_cache_key. Useprompt_cache_keyinstead to maintain caching optimizations. A stable identifier for your end-users. Used to boost cache hit rates by better bucketing similar requests and to help OpenAI detect and prevent abuse. Learn more.
-
user
@Deprecated(message = "deprecated") final ResponsesClientEvent.Builder user(JsonField<String> user)
Sets Builder.user to an arbitrary JSON value.
You should usually call Builder.user with a well-typed String value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
additionalProperties
final ResponsesClientEvent.Builder additionalProperties(Map<String, JsonValue> additionalProperties)
-
putAdditionalProperty
final ResponsesClientEvent.Builder putAdditionalProperty(String key, JsonValue value)
-
putAllAdditionalProperties
final ResponsesClientEvent.Builder putAllAdditionalProperties(Map<String, JsonValue> additionalProperties)
-
removeAdditionalProperty
final ResponsesClientEvent.Builder removeAdditionalProperty(String key)
-
removeAllAdditionalProperties
final ResponsesClientEvent.Builder removeAllAdditionalProperties(Set<String> keys)
-
build
final ResponsesClientEvent build()
Returns an immutable instance of ResponsesClientEvent.
Further updates to this Builder will not mutate the returned instance.
-
-
-
-