Class AssistantCreateParams.Builder
-
- All Implemented Interfaces:
public final class AssistantCreateParams.Builder
A builder for AssistantCreateParams.
-
-
Method Summary
-
-
Method Detail
-
model
final AssistantCreateParams.Builder model(ChatModel model)
ID of the model to use. You can use the List models API to see all of your available models, or see our Model overview for descriptions of them.
-
model
final AssistantCreateParams.Builder model(JsonField<ChatModel> model)
ID of the model to use. You can use the List models API to see all of your available models, or see our Model overview for descriptions of them.
-
model
final AssistantCreateParams.Builder model(String value)
ID of the model to use. You can use the List models API to see all of your available models, or see our Model overview for descriptions of them.
-
description
final AssistantCreateParams.Builder description(String description)
The description of the assistant. The maximum length is 512 characters.
-
description
final AssistantCreateParams.Builder description(Optional<String> description)
The description of the assistant. The maximum length is 512 characters.
-
description
final AssistantCreateParams.Builder description(JsonField<String> description)
The description of the assistant. The maximum length is 512 characters.
-
instructions
final AssistantCreateParams.Builder instructions(String instructions)
The system instructions that the assistant uses. The maximum length is 256,000 characters.
-
instructions
final AssistantCreateParams.Builder instructions(Optional<String> instructions)
The system instructions that the assistant uses. The maximum length is 256,000 characters.
-
instructions
final AssistantCreateParams.Builder instructions(JsonField<String> instructions)
The system instructions that the assistant uses. The maximum length is 256,000 characters.
-
metadata
final AssistantCreateParams.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 AssistantCreateParams.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 AssistantCreateParams.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.
-
name
final AssistantCreateParams.Builder name(String name)
The name of the assistant. The maximum length is 256 characters.
-
name
final AssistantCreateParams.Builder name(Optional<String> name)
The name of the assistant. The maximum length is 256 characters.
-
name
final AssistantCreateParams.Builder name(JsonField<String> name)
The name of the assistant. The maximum length is 256 characters.
-
reasoningEffort
final AssistantCreateParams.Builder reasoningEffort(ReasoningEffort reasoningEffort)
o-series models only
Constrains effort on reasoning for reasoning models. Currently supported values are
low
,medium
, andhigh
. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response.
-
reasoningEffort
final AssistantCreateParams.Builder reasoningEffort(Optional<ReasoningEffort> reasoningEffort)
o-series models only
Constrains effort on reasoning for reasoning models. Currently supported values are
low
,medium
, andhigh
. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response.
-
reasoningEffort
final AssistantCreateParams.Builder reasoningEffort(JsonField<ReasoningEffort> reasoningEffort)
o-series models only
Constrains effort on reasoning for reasoning models. Currently supported values are
low
,medium
, andhigh
. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response.
-
responseFormat
final AssistantCreateParams.Builder responseFormat(AssistantResponseFormatOption responseFormat)
Specifies the format that the model must output. Compatible with GPT-4o, GPT-4 * Turbo, and all GPT-3.5 Turbo models since
gpt-3.5-turbo-1106
.Setting to
{ "type": "json_schema", "json_schema": {...} }
enables Structured Outputs which ensures the model will match your supplied JSON schema. Learn more in the Structured Outputs guide.Setting to
{ "type": "json_object" }
enables JSON mode, which ensures the message the model generates is valid JSON.Important: when using JSON mode, you must also instruct the model to produce JSON yourself via a system or user message. Without this, the model may generate an unending stream of whitespace until the generation reaches the token limit, resulting in a long-running and seemingly "stuck" request. Also note that the message content may be partially cut off if
finish_reason="length"
, which indicates the generation exceededmax_tokens
or the conversation exceeded the max context length.
-
responseFormat
final AssistantCreateParams.Builder responseFormat(Optional<AssistantResponseFormatOption> responseFormat)
Specifies the format that the model must output. Compatible with GPT-4o, GPT-4 * Turbo, and all GPT-3.5 Turbo models since
gpt-3.5-turbo-1106
.Setting to
{ "type": "json_schema", "json_schema": {...} }
enables Structured Outputs which ensures the model will match your supplied JSON schema. Learn more in the Structured Outputs guide.Setting to
{ "type": "json_object" }
enables JSON mode, which ensures the message the model generates is valid JSON.Important: when using JSON mode, you must also instruct the model to produce JSON yourself via a system or user message. Without this, the model may generate an unending stream of whitespace until the generation reaches the token limit, resulting in a long-running and seemingly "stuck" request. Also note that the message content may be partially cut off if
finish_reason="length"
, which indicates the generation exceededmax_tokens
or the conversation exceeded the max context length.
-
responseFormat
final AssistantCreateParams.Builder responseFormat(JsonField<AssistantResponseFormatOption> responseFormat)
Specifies the format that the model must output. Compatible with GPT-4o, GPT-4 * Turbo, and all GPT-3.5 Turbo models since
gpt-3.5-turbo-1106
.Setting to
{ "type": "json_schema", "json_schema": {...} }
enables Structured Outputs which ensures the model will match your supplied JSON schema. Learn more in the Structured Outputs guide.Setting to
{ "type": "json_object" }
enables JSON mode, which ensures the message the model generates is valid JSON.Important: when using JSON mode, you must also instruct the model to produce JSON yourself via a system or user message. Without this, the model may generate an unending stream of whitespace until the generation reaches the token limit, resulting in a long-running and seemingly "stuck" request. Also note that the message content may be partially cut off if
finish_reason="length"
, which indicates the generation exceededmax_tokens
or the conversation exceeded the max context length.
-
responseFormat
final AssistantCreateParams.Builder responseFormat(ResponseFormatText responseFormatText)
Default response format. Used to generate text responses.
-
responseFormat
final AssistantCreateParams.Builder responseFormat(ResponseFormatJsonObject responseFormatJsonObject)
JSON object response format. An older method of generating JSON responses. Using
json_schema
is recommended for models that support it. Note that the model will not generate JSON without a system or user message instructing it to do so.
-
responseFormat
final AssistantCreateParams.Builder responseFormat(ResponseFormatJsonSchema responseFormatJsonSchema)
JSON Schema response format. Used to generate structured JSON responses. Learn more about Structured Outputs.
-
responseFormatJsonValue
final AssistantCreateParams.Builder responseFormatJsonValue()
auto
is the default value
-
temperature
final AssistantCreateParams.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.
-
temperature
final AssistantCreateParams.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.
-
temperature
final AssistantCreateParams.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.
-
temperature
final AssistantCreateParams.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.
-
toolResources
final AssistantCreateParams.Builder toolResources(AssistantCreateParams.ToolResources toolResources)
A set of resources that are used by the assistant's tools. The resources are specific to the type of tool. For example, the
code_interpreter
tool requires a list of file IDs, while thefile_search
tool requires a list of vector store IDs.
-
toolResources
final AssistantCreateParams.Builder toolResources(Optional<AssistantCreateParams.ToolResources> toolResources)
A set of resources that are used by the assistant's tools. The resources are specific to the type of tool. For example, the
code_interpreter
tool requires a list of file IDs, while thefile_search
tool requires a list of vector store IDs.
-
toolResources
final AssistantCreateParams.Builder toolResources(JsonField<AssistantCreateParams.ToolResources> toolResources)
A set of resources that are used by the assistant's tools. The resources are specific to the type of tool. For example, the
code_interpreter
tool requires a list of file IDs, while thefile_search
tool requires a list of vector store IDs.
-
tools
final AssistantCreateParams.Builder tools(List<AssistantTool> tools)
A list of tool enabled on the assistant. There can be a maximum of 128 tools per assistant. Tools can be of types
code_interpreter
,file_search
, orfunction
.
-
tools
final AssistantCreateParams.Builder tools(JsonField<List<AssistantTool>> tools)
A list of tool enabled on the assistant. There can be a maximum of 128 tools per assistant. Tools can be of types
code_interpreter
,file_search
, orfunction
.
-
addTool
final AssistantCreateParams.Builder addTool(AssistantTool tool)
A list of tool enabled on the assistant. There can be a maximum of 128 tools per assistant. Tools can be of types
code_interpreter
,file_search
, orfunction
.
-
addTool
final AssistantCreateParams.Builder addTool(CodeInterpreterTool codeInterpreter)
A list of tool enabled on the assistant. There can be a maximum of 128 tools per assistant. Tools can be of types
code_interpreter
,file_search
, orfunction
.
-
addTool
final AssistantCreateParams.Builder addTool(FileSearchTool fileSearch)
A list of tool enabled on the assistant. There can be a maximum of 128 tools per assistant. Tools can be of types
code_interpreter
,file_search
, orfunction
.
-
addTool
final AssistantCreateParams.Builder addTool(FunctionTool function)
A list of tool enabled on the assistant. There can be a maximum of 128 tools per assistant. Tools can be of types
code_interpreter
,file_search
, orfunction
.
-
addFunctionTool
final AssistantCreateParams.Builder addFunctionTool(FunctionDefinition function)
A list of tool enabled on the assistant. There can be a maximum of 128 tools per assistant. Tools can be of types
code_interpreter
,file_search
, orfunction
.
-
topP
final AssistantCreateParams.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 AssistantCreateParams.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 AssistantCreateParams.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 AssistantCreateParams.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.
-
additionalBodyProperties
final AssistantCreateParams.Builder additionalBodyProperties(Map<String, JsonValue> additionalBodyProperties)
-
putAdditionalBodyProperty
final AssistantCreateParams.Builder putAdditionalBodyProperty(String key, JsonValue value)
-
putAllAdditionalBodyProperties
final AssistantCreateParams.Builder putAllAdditionalBodyProperties(Map<String, JsonValue> additionalBodyProperties)
-
removeAdditionalBodyProperty
final AssistantCreateParams.Builder removeAdditionalBodyProperty(String key)
-
removeAllAdditionalBodyProperties
final AssistantCreateParams.Builder removeAllAdditionalBodyProperties(Set<String> keys)
-
additionalHeaders
final AssistantCreateParams.Builder additionalHeaders(Headers additionalHeaders)
-
additionalHeaders
final AssistantCreateParams.Builder additionalHeaders(Map<String, Iterable<String>> additionalHeaders)
-
putAdditionalHeader
final AssistantCreateParams.Builder putAdditionalHeader(String name, String value)
-
putAdditionalHeaders
final AssistantCreateParams.Builder putAdditionalHeaders(String name, Iterable<String> values)
-
putAllAdditionalHeaders
final AssistantCreateParams.Builder putAllAdditionalHeaders(Headers additionalHeaders)
-
putAllAdditionalHeaders
final AssistantCreateParams.Builder putAllAdditionalHeaders(Map<String, Iterable<String>> additionalHeaders)
-
replaceAdditionalHeaders
final AssistantCreateParams.Builder replaceAdditionalHeaders(String name, String value)
-
replaceAdditionalHeaders
final AssistantCreateParams.Builder replaceAdditionalHeaders(String name, Iterable<String> values)
-
replaceAllAdditionalHeaders
final AssistantCreateParams.Builder replaceAllAdditionalHeaders(Headers additionalHeaders)
-
replaceAllAdditionalHeaders
final AssistantCreateParams.Builder replaceAllAdditionalHeaders(Map<String, Iterable<String>> additionalHeaders)
-
removeAdditionalHeaders
final AssistantCreateParams.Builder removeAdditionalHeaders(String name)
-
removeAllAdditionalHeaders
final AssistantCreateParams.Builder removeAllAdditionalHeaders(Set<String> names)
-
additionalQueryParams
final AssistantCreateParams.Builder additionalQueryParams(QueryParams additionalQueryParams)
-
additionalQueryParams
final AssistantCreateParams.Builder additionalQueryParams(Map<String, Iterable<String>> additionalQueryParams)
-
putAdditionalQueryParam
final AssistantCreateParams.Builder putAdditionalQueryParam(String key, String value)
-
putAdditionalQueryParams
final AssistantCreateParams.Builder putAdditionalQueryParams(String key, Iterable<String> values)
-
putAllAdditionalQueryParams
final AssistantCreateParams.Builder putAllAdditionalQueryParams(QueryParams additionalQueryParams)
-
putAllAdditionalQueryParams
final AssistantCreateParams.Builder putAllAdditionalQueryParams(Map<String, Iterable<String>> additionalQueryParams)
-
replaceAdditionalQueryParams
final AssistantCreateParams.Builder replaceAdditionalQueryParams(String key, String value)
-
replaceAdditionalQueryParams
final AssistantCreateParams.Builder replaceAdditionalQueryParams(String key, Iterable<String> values)
-
replaceAllAdditionalQueryParams
final AssistantCreateParams.Builder replaceAllAdditionalQueryParams(QueryParams additionalQueryParams)
-
replaceAllAdditionalQueryParams
final AssistantCreateParams.Builder replaceAllAdditionalQueryParams(Map<String, Iterable<String>> additionalQueryParams)
-
removeAdditionalQueryParams
final AssistantCreateParams.Builder removeAdditionalQueryParams(String key)
-
removeAllAdditionalQueryParams
final AssistantCreateParams.Builder removeAllAdditionalQueryParams(Set<String> keys)
-
build
final AssistantCreateParams build()
-
-
-
-