Class ResponseCreateParams.Builder
-
- All Implemented Interfaces:
public final class ResponseCreateParams.Builder
A builder for ResponseCreateParams.
-
-
Method Summary
Modifier and Type Method Description final ResponseCreateParams.Builder
input(ResponseCreateParams.Input input)
Text, image, or file inputs to the model, used to generate a response. final ResponseCreateParams.Builder
input(JsonField<ResponseCreateParams.Input> input)
Text, image, or file inputs to the model, used to generate a response. final ResponseCreateParams.Builder
input(String text)
A text input to the model, equivalent to a text input with the user
role.final ResponseCreateParams.Builder
inputOfResponse(List<ResponseInputItem> response)
A list of one or many input items to the model, containing different content types. final ResponseCreateParams.Builder
model(ChatModel model)
Model ID used to generate the response, like gpt-4o
oro1
.final ResponseCreateParams.Builder
model(JsonField<ChatModel> model)
Model ID used to generate the response, like gpt-4o
oro1
.final ResponseCreateParams.Builder
model(String value)
Model ID used to generate the response, like gpt-4o
oro1
.final ResponseCreateParams.Builder
include(List<ResponseIncludable> include)
Specify additional output data to include in the model response. final ResponseCreateParams.Builder
include(Optional<List<ResponseIncludable>> include)
Specify additional output data to include in the model response. final ResponseCreateParams.Builder
include(JsonField<List<ResponseIncludable>> include)
Specify additional output data to include in the model response. final ResponseCreateParams.Builder
addInclude(ResponseIncludable include)
Specify additional output data to include in the model response. final ResponseCreateParams.Builder
instructions(String instructions)
Inserts a system (or developer) message as the first item in the model's context. final ResponseCreateParams.Builder
instructions(Optional<String> instructions)
Inserts a system (or developer) message as the first item in the model's context. final ResponseCreateParams.Builder
instructions(JsonField<String> instructions)
Inserts a system (or developer) message as the first item in the model's context. final ResponseCreateParams.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. final ResponseCreateParams.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. final ResponseCreateParams.Builder
maxOutputTokens(Optional<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 ResponseCreateParams.Builder
maxOutputTokens(JsonField<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 ResponseCreateParams.Builder
metadata(Metadata metadata)
Set of 16 key-value pairs that can be attached to an object. final ResponseCreateParams.Builder
metadata(Optional<Metadata> metadata)
Set of 16 key-value pairs that can be attached to an object. final ResponseCreateParams.Builder
metadata(JsonField<Metadata> metadata)
Set of 16 key-value pairs that can be attached to an object. final ResponseCreateParams.Builder
parallelToolCalls(Boolean parallelToolCalls)
Whether to allow the model to run tool calls in parallel. final ResponseCreateParams.Builder
parallelToolCalls(Boolean parallelToolCalls)
Whether to allow the model to run tool calls in parallel. final ResponseCreateParams.Builder
parallelToolCalls(Optional<Boolean> parallelToolCalls)
Whether to allow the model to run tool calls in parallel. final ResponseCreateParams.Builder
parallelToolCalls(JsonField<Boolean> parallelToolCalls)
Whether to allow the model to run tool calls in parallel. final ResponseCreateParams.Builder
previousResponseId(String previousResponseId)
The unique ID of the previous response to the model. final ResponseCreateParams.Builder
previousResponseId(Optional<String> previousResponseId)
The unique ID of the previous response to the model. final ResponseCreateParams.Builder
previousResponseId(JsonField<String> previousResponseId)
The unique ID of the previous response to the model. final ResponseCreateParams.Builder
reasoning(Reasoning reasoning)
o-series models onlyConfiguration options for reasoning models. final ResponseCreateParams.Builder
reasoning(Optional<Reasoning> reasoning)
o-series models onlyConfiguration options for reasoning models. final ResponseCreateParams.Builder
reasoning(JsonField<Reasoning> reasoning)
o-series models onlyConfiguration options for reasoning models. final ResponseCreateParams.Builder
store(Boolean store)
Whether to store the generated model response for later retrieval via API. final ResponseCreateParams.Builder
store(Boolean store)
Whether to store the generated model response for later retrieval via API. final ResponseCreateParams.Builder
store(Optional<Boolean> store)
Whether to store the generated model response for later retrieval via API. final ResponseCreateParams.Builder
store(JsonField<Boolean> store)
Whether to store the generated model response for later retrieval via API. final ResponseCreateParams.Builder
temperature(Double temperature)
What sampling temperature to use, between 0 and 2. final ResponseCreateParams.Builder
temperature(Double temperature)
What sampling temperature to use, between 0 and 2. final ResponseCreateParams.Builder
temperature(Optional<Double> temperature)
What sampling temperature to use, between 0 and 2. final ResponseCreateParams.Builder
temperature(JsonField<Double> temperature)
What sampling temperature to use, between 0 and 2. final ResponseCreateParams.Builder
text(ResponseTextConfig text)
Configuration options for a text response from the model. final ResponseCreateParams.Builder
text(JsonField<ResponseTextConfig> text)
Configuration options for a text response from the model. final ResponseCreateParams.Builder
toolChoice(ResponseCreateParams.ToolChoice toolChoice)
How the model should select which tool (or tools) to use when generating a response. final ResponseCreateParams.Builder
toolChoice(JsonField<ResponseCreateParams.ToolChoice> toolChoice)
How the model should select which tool (or tools) to use when generating a response. final ResponseCreateParams.Builder
toolChoice(ToolChoiceOptions options)
Controls which (if any) tool is called by the model. final ResponseCreateParams.Builder
toolChoice(ToolChoiceTypes types)
Indicates that the model should use a built-in tool to generate a response. final ResponseCreateParams.Builder
toolChoice(ToolChoiceFunction function)
Use this option to force the model to call a specific function. final ResponseCreateParams.Builder
tools(List<Tool> tools)
An array of tools the model may call while generating a response. final ResponseCreateParams.Builder
tools(JsonField<List<Tool>> tools)
An array of tools the model may call while generating a response. final ResponseCreateParams.Builder
addTool(Tool tool)
An array of tools the model may call while generating a response. final ResponseCreateParams.Builder
addTool(FileSearchTool fileSearch)
A tool that searches for relevant content from uploaded files. final ResponseCreateParams.Builder
addTool(FunctionTool function)
Defines a function in your own code the model can choose to call. final ResponseCreateParams.Builder
addTool(ComputerTool computerPreview)
A tool that controls a virtual computer. final ResponseCreateParams.Builder
addTool(WebSearchTool webSearch)
This tool searches the web for relevant results to use in a response. final ResponseCreateParams.Builder
addFileSearchTool(List<String> vectorStoreIds)
A tool that searches for relevant content from uploaded files. final ResponseCreateParams.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. final ResponseCreateParams.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. final ResponseCreateParams.Builder
topP(Optional<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 ResponseCreateParams.Builder
topP(JsonField<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 ResponseCreateParams.Builder
truncation(ResponseCreateParams.Truncation truncation)
The truncation strategy to use for the model response. final ResponseCreateParams.Builder
truncation(Optional<ResponseCreateParams.Truncation> truncation)
The truncation strategy to use for the model response. final ResponseCreateParams.Builder
truncation(JsonField<ResponseCreateParams.Truncation> truncation)
The truncation strategy to use for the model response. final ResponseCreateParams.Builder
user(String user)
A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse. final ResponseCreateParams.Builder
user(JsonField<String> user)
A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse. final ResponseCreateParams.Builder
additionalBodyProperties(Map<String, JsonValue> additionalBodyProperties)
final ResponseCreateParams.Builder
putAdditionalBodyProperty(String key, JsonValue value)
final ResponseCreateParams.Builder
putAllAdditionalBodyProperties(Map<String, JsonValue> additionalBodyProperties)
final ResponseCreateParams.Builder
removeAdditionalBodyProperty(String key)
final ResponseCreateParams.Builder
removeAllAdditionalBodyProperties(Set<String> keys)
final ResponseCreateParams.Builder
additionalHeaders(Headers additionalHeaders)
final ResponseCreateParams.Builder
additionalHeaders(Map<String, Iterable<String>> additionalHeaders)
final ResponseCreateParams.Builder
putAdditionalHeader(String name, String value)
final ResponseCreateParams.Builder
putAdditionalHeaders(String name, Iterable<String> values)
final ResponseCreateParams.Builder
putAllAdditionalHeaders(Headers additionalHeaders)
final ResponseCreateParams.Builder
putAllAdditionalHeaders(Map<String, Iterable<String>> additionalHeaders)
final ResponseCreateParams.Builder
replaceAdditionalHeaders(String name, String value)
final ResponseCreateParams.Builder
replaceAdditionalHeaders(String name, Iterable<String> values)
final ResponseCreateParams.Builder
replaceAllAdditionalHeaders(Headers additionalHeaders)
final ResponseCreateParams.Builder
replaceAllAdditionalHeaders(Map<String, Iterable<String>> additionalHeaders)
final ResponseCreateParams.Builder
removeAdditionalHeaders(String name)
final ResponseCreateParams.Builder
removeAllAdditionalHeaders(Set<String> names)
final ResponseCreateParams.Builder
additionalQueryParams(QueryParams additionalQueryParams)
final ResponseCreateParams.Builder
additionalQueryParams(Map<String, Iterable<String>> additionalQueryParams)
final ResponseCreateParams.Builder
putAdditionalQueryParam(String key, String value)
final ResponseCreateParams.Builder
putAdditionalQueryParams(String key, Iterable<String> values)
final ResponseCreateParams.Builder
putAllAdditionalQueryParams(QueryParams additionalQueryParams)
final ResponseCreateParams.Builder
putAllAdditionalQueryParams(Map<String, Iterable<String>> additionalQueryParams)
final ResponseCreateParams.Builder
replaceAdditionalQueryParams(String key, String value)
final ResponseCreateParams.Builder
replaceAdditionalQueryParams(String key, Iterable<String> values)
final ResponseCreateParams.Builder
replaceAllAdditionalQueryParams(QueryParams additionalQueryParams)
final ResponseCreateParams.Builder
replaceAllAdditionalQueryParams(Map<String, Iterable<String>> additionalQueryParams)
final ResponseCreateParams.Builder
removeAdditionalQueryParams(String key)
final ResponseCreateParams.Builder
removeAllAdditionalQueryParams(Set<String> keys)
final ResponseCreateParams
build()
-
-
Method Detail
-
input
final ResponseCreateParams.Builder input(ResponseCreateParams.Input input)
Text, image, or file inputs to the model, used to generate a response.
Learn more:
-
input
final ResponseCreateParams.Builder input(JsonField<ResponseCreateParams.Input> input)
Text, image, or file inputs to the model, used to generate a response.
Learn more:
-
input
final ResponseCreateParams.Builder input(String text)
A text input to the model, equivalent to a text input with the
user
role.
-
inputOfResponse
final ResponseCreateParams.Builder inputOfResponse(List<ResponseInputItem> response)
A list of one or many input items to the model, containing different content types.
-
model
final ResponseCreateParams.Builder model(ChatModel model)
Model ID used to generate the response, like
gpt-4o
oro1
. 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 ResponseCreateParams.Builder model(JsonField<ChatModel> model)
Model ID used to generate the response, like
gpt-4o
oro1
. 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 ResponseCreateParams.Builder model(String value)
Model ID used to generate the response, like
gpt-4o
oro1
. 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.
-
include
final ResponseCreateParams.Builder include(List<ResponseIncludable> include)
Specify additional output data to include in the model response. Currently supported values are:
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.computer_call_output.output.image_url
: Include image urls from the computer call output.
-
include
final ResponseCreateParams.Builder include(Optional<List<ResponseIncludable>> include)
Specify additional output data to include in the model response. Currently supported values are:
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.computer_call_output.output.image_url
: Include image urls from the computer call output.
-
include
final ResponseCreateParams.Builder include(JsonField<List<ResponseIncludable>> include)
Specify additional output data to include in the model response. Currently supported values are:
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.computer_call_output.output.image_url
: Include image urls from the computer call output.
-
addInclude
final ResponseCreateParams.Builder addInclude(ResponseIncludable include)
Specify additional output data to include in the model response. Currently supported values are:
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.computer_call_output.output.image_url
: Include image urls from the computer call output.
-
instructions
final ResponseCreateParams.Builder instructions(String instructions)
Inserts a system (or developer) message as the first item in the model's context.
When using along with
previous_response_id
, the instructions from a previous response will be not be carried over to the next response. This makes it simple to swap out system (or developer) messages in new responses.
-
instructions
final ResponseCreateParams.Builder instructions(Optional<String> instructions)
Inserts a system (or developer) message as the first item in the model's context.
When using along with
previous_response_id
, the instructions from a previous response will be not be carried over to the next response. This makes it simple to swap out system (or developer) messages in new responses.
-
instructions
final ResponseCreateParams.Builder instructions(JsonField<String> instructions)
Inserts a system (or developer) message as the first item in the model's context.
When using along with
previous_response_id
, the instructions from a previous response will be not be carried over to the next response. This makes it simple to swap out system (or developer) messages in new responses.
-
maxOutputTokens
final ResponseCreateParams.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 ResponseCreateParams.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 ResponseCreateParams.Builder maxOutputTokens(Optional<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 ResponseCreateParams.Builder maxOutputTokens(JsonField<Long> maxOutputTokens)
An upper bound for the number of tokens that can be generated for a response, including visible output tokens and reasoning tokens.
-
metadata
final ResponseCreateParams.Builder metadata(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 ResponseCreateParams.Builder metadata(Optional<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 ResponseCreateParams.Builder metadata(JsonField<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.
-
parallelToolCalls
final ResponseCreateParams.Builder parallelToolCalls(Boolean parallelToolCalls)
Whether to allow the model to run tool calls in parallel.
-
parallelToolCalls
final ResponseCreateParams.Builder parallelToolCalls(Boolean parallelToolCalls)
Whether to allow the model to run tool calls in parallel.
-
parallelToolCalls
final ResponseCreateParams.Builder parallelToolCalls(Optional<Boolean> parallelToolCalls)
Whether to allow the model to run tool calls in parallel.
-
parallelToolCalls
final ResponseCreateParams.Builder parallelToolCalls(JsonField<Boolean> parallelToolCalls)
Whether to allow the model to run tool calls in parallel.
-
previousResponseId
final ResponseCreateParams.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.
-
previousResponseId
final ResponseCreateParams.Builder previousResponseId(Optional<String> previousResponseId)
The unique ID of the previous response to the model. Use this to create multi-turn conversations. Learn more about conversation state.
-
previousResponseId
final ResponseCreateParams.Builder previousResponseId(JsonField<String> previousResponseId)
The unique ID of the previous response to the model. Use this to create multi-turn conversations. Learn more about conversation state.
-
reasoning
final ResponseCreateParams.Builder reasoning(Reasoning reasoning)
o-series models only
Configuration options for reasoning models.
-
reasoning
final ResponseCreateParams.Builder reasoning(Optional<Reasoning> reasoning)
o-series models only
Configuration options for reasoning models.
-
reasoning
final ResponseCreateParams.Builder reasoning(JsonField<Reasoning> reasoning)
o-series models only
Configuration options for reasoning models.
-
store
final ResponseCreateParams.Builder store(Boolean store)
Whether to store the generated model response for later retrieval via API.
-
store
final ResponseCreateParams.Builder store(Boolean store)
Whether to store the generated model response for later retrieval via API.
-
store
final ResponseCreateParams.Builder store(Optional<Boolean> store)
Whether to store the generated model response for later retrieval via API.
-
store
final ResponseCreateParams.Builder store(JsonField<Boolean> store)
Whether to store the generated model response for later retrieval via API.
-
temperature
final ResponseCreateParams.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_p
but not both.
-
temperature
final ResponseCreateParams.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_p
but not both.
-
temperature
final ResponseCreateParams.Builder temperature(Optional<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_p
but not both.
-
temperature
final ResponseCreateParams.Builder temperature(JsonField<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_p
but not both.
-
text
final ResponseCreateParams.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 ResponseCreateParams.Builder text(JsonField<ResponseTextConfig> text)
Configuration options for a text response from the model. Can be plain text or structured JSON data. Learn more:
-
toolChoice
final ResponseCreateParams.Builder toolChoice(ResponseCreateParams.ToolChoice toolChoice)
How the model should select which tool (or tools) to use when generating a response. See the
tools
parameter to see how to specify which tools the model can call.
-
toolChoice
final ResponseCreateParams.Builder toolChoice(JsonField<ResponseCreateParams.ToolChoice> toolChoice)
How the model should select which tool (or tools) to use when generating a response. See the
tools
parameter to see how to specify which tools the model can call.
-
toolChoice
final ResponseCreateParams.Builder toolChoice(ToolChoiceOptions options)
Controls which (if any) tool is called by the model.
none
means the model will not call any tool and instead generates a message.auto
means the model can pick between generating a message or calling one or more tools.required
means the model must call one or more tools.
-
toolChoice
final ResponseCreateParams.Builder toolChoice(ToolChoiceTypes types)
Indicates that the model should use a built-in tool to generate a response. Learn more about built-in tools.
-
toolChoice
final ResponseCreateParams.Builder toolChoice(ToolChoiceFunction function)
Use this option to force the model to call a specific function.
-
tools
final ResponseCreateParams.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_choice
parameter.The two categories of tools you can provide the model are:
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.
Function calls (custom tools): Functions that are defined by you, enabling the model to call your own code. Learn more about function calling.
-
tools
final ResponseCreateParams.Builder tools(JsonField<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_choice
parameter.The two categories of tools you can provide the model are:
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.
Function calls (custom tools): Functions that are defined by you, enabling the model to call your own code. Learn more about function calling.
-
addTool
final ResponseCreateParams.Builder addTool(Tool tool)
An array of tools the model may call while generating a response. You can specify which tool to use by setting the
tool_choice
parameter.The two categories of tools you can provide the model are:
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.
Function calls (custom tools): Functions that are defined by you, enabling the model to call your own code. Learn more about function calling.
-
addTool
final ResponseCreateParams.Builder addTool(FileSearchTool fileSearch)
A tool that searches for relevant content from uploaded files. Learn more about the file search tool.
-
addTool
final ResponseCreateParams.Builder addTool(FunctionTool function)
Defines a function in your own code the model can choose to call. Learn more about function calling.
-
addTool
final ResponseCreateParams.Builder addTool(ComputerTool computerPreview)
A tool that controls a virtual computer. Learn more about the computer tool.
-
addTool
final ResponseCreateParams.Builder addTool(WebSearchTool webSearch)
This tool searches the web for relevant results to use in a response. Learn more about the web search tool.
-
addFileSearchTool
final ResponseCreateParams.Builder addFileSearchTool(List<String> vectorStoreIds)
A tool that searches for relevant content from uploaded files. Learn more about the file search tool.
-
topP
final ResponseCreateParams.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
temperature
but not both.
-
topP
final ResponseCreateParams.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
temperature
but not both.
-
topP
final ResponseCreateParams.Builder topP(Optional<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
temperature
but not both.
-
topP
final ResponseCreateParams.Builder topP(JsonField<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
temperature
but not both.
-
truncation
final ResponseCreateParams.Builder truncation(ResponseCreateParams.Truncation truncation)
The truncation strategy to use for the model response.
auto
: If the context of this response and previous ones exceeds the model's context window size, the model will truncate the response to fit the context window by dropping input items in the middle of the conversation.disabled
(default): If a model response will exceed the context window size for a model, the request will fail with a 400 error.
-
truncation
final ResponseCreateParams.Builder truncation(Optional<ResponseCreateParams.Truncation> truncation)
The truncation strategy to use for the model response.
auto
: If the context of this response and previous ones exceeds the model's context window size, the model will truncate the response to fit the context window by dropping input items in the middle of the conversation.disabled
(default): If a model response will exceed the context window size for a model, the request will fail with a 400 error.
-
truncation
final ResponseCreateParams.Builder truncation(JsonField<ResponseCreateParams.Truncation> truncation)
The truncation strategy to use for the model response.
auto
: If the context of this response and previous ones exceeds the model's context window size, the model will truncate the response to fit the context window by dropping input items in the middle of the conversation.disabled
(default): If a model response will exceed the context window size for a model, the request will fail with a 400 error.
-
user
final ResponseCreateParams.Builder user(String user)
A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse. Learn more.
-
user
final ResponseCreateParams.Builder user(JsonField<String> user)
A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse. Learn more.
-
additionalBodyProperties
final ResponseCreateParams.Builder additionalBodyProperties(Map<String, JsonValue> additionalBodyProperties)
-
putAdditionalBodyProperty
final ResponseCreateParams.Builder putAdditionalBodyProperty(String key, JsonValue value)
-
putAllAdditionalBodyProperties
final ResponseCreateParams.Builder putAllAdditionalBodyProperties(Map<String, JsonValue> additionalBodyProperties)
-
removeAdditionalBodyProperty
final ResponseCreateParams.Builder removeAdditionalBodyProperty(String key)
-
removeAllAdditionalBodyProperties
final ResponseCreateParams.Builder removeAllAdditionalBodyProperties(Set<String> keys)
-
additionalHeaders
final ResponseCreateParams.Builder additionalHeaders(Headers additionalHeaders)
-
additionalHeaders
final ResponseCreateParams.Builder additionalHeaders(Map<String, Iterable<String>> additionalHeaders)
-
putAdditionalHeader
final ResponseCreateParams.Builder putAdditionalHeader(String name, String value)
-
putAdditionalHeaders
final ResponseCreateParams.Builder putAdditionalHeaders(String name, Iterable<String> values)
-
putAllAdditionalHeaders
final ResponseCreateParams.Builder putAllAdditionalHeaders(Headers additionalHeaders)
-
putAllAdditionalHeaders
final ResponseCreateParams.Builder putAllAdditionalHeaders(Map<String, Iterable<String>> additionalHeaders)
-
replaceAdditionalHeaders
final ResponseCreateParams.Builder replaceAdditionalHeaders(String name, String value)
-
replaceAdditionalHeaders
final ResponseCreateParams.Builder replaceAdditionalHeaders(String name, Iterable<String> values)
-
replaceAllAdditionalHeaders
final ResponseCreateParams.Builder replaceAllAdditionalHeaders(Headers additionalHeaders)
-
replaceAllAdditionalHeaders
final ResponseCreateParams.Builder replaceAllAdditionalHeaders(Map<String, Iterable<String>> additionalHeaders)
-
removeAdditionalHeaders
final ResponseCreateParams.Builder removeAdditionalHeaders(String name)
-
removeAllAdditionalHeaders
final ResponseCreateParams.Builder removeAllAdditionalHeaders(Set<String> names)
-
additionalQueryParams
final ResponseCreateParams.Builder additionalQueryParams(QueryParams additionalQueryParams)
-
additionalQueryParams
final ResponseCreateParams.Builder additionalQueryParams(Map<String, Iterable<String>> additionalQueryParams)
-
putAdditionalQueryParam
final ResponseCreateParams.Builder putAdditionalQueryParam(String key, String value)
-
putAdditionalQueryParams
final ResponseCreateParams.Builder putAdditionalQueryParams(String key, Iterable<String> values)
-
putAllAdditionalQueryParams
final ResponseCreateParams.Builder putAllAdditionalQueryParams(QueryParams additionalQueryParams)
-
putAllAdditionalQueryParams
final ResponseCreateParams.Builder putAllAdditionalQueryParams(Map<String, Iterable<String>> additionalQueryParams)
-
replaceAdditionalQueryParams
final ResponseCreateParams.Builder replaceAdditionalQueryParams(String key, String value)
-
replaceAdditionalQueryParams
final ResponseCreateParams.Builder replaceAdditionalQueryParams(String key, Iterable<String> values)
-
replaceAllAdditionalQueryParams
final ResponseCreateParams.Builder replaceAllAdditionalQueryParams(QueryParams additionalQueryParams)
-
replaceAllAdditionalQueryParams
final ResponseCreateParams.Builder replaceAllAdditionalQueryParams(Map<String, Iterable<String>> additionalQueryParams)
-
removeAdditionalQueryParams
final ResponseCreateParams.Builder removeAdditionalQueryParams(String key)
-
removeAllAdditionalQueryParams
final ResponseCreateParams.Builder removeAllAdditionalQueryParams(Set<String> keys)
-
build
final ResponseCreateParams build()
-
-
-
-