Class Run.Builder
-
- All Implemented Interfaces:
public final class Run.Builder
A builder for Run.
-
-
Method Summary
Modifier and Type Method Description final Run.Builder
id(String id)
The identifier, which can be referenced in API endpoints. final Run.Builder
id(JsonField<String> id)
The identifier, which can be referenced in API endpoints. final Run.Builder
assistantId(String assistantId)
The ID of the assistant used for execution of this run. final Run.Builder
assistantId(JsonField<String> assistantId)
The ID of the assistant used for execution of this run. final Run.Builder
cancelledAt(Long cancelledAt)
The Unix timestamp (in seconds) for when the run was cancelled. final Run.Builder
cancelledAt(Long cancelledAt)
The Unix timestamp (in seconds) for when the run was cancelled. final Run.Builder
cancelledAt(Optional<Long> cancelledAt)
The Unix timestamp (in seconds) for when the run was cancelled. final Run.Builder
cancelledAt(JsonField<Long> cancelledAt)
The Unix timestamp (in seconds) for when the run was cancelled. final Run.Builder
completedAt(Long completedAt)
The Unix timestamp (in seconds) for when the run was completed. final Run.Builder
completedAt(Long completedAt)
The Unix timestamp (in seconds) for when the run was completed. final Run.Builder
completedAt(Optional<Long> completedAt)
The Unix timestamp (in seconds) for when the run was completed. final Run.Builder
completedAt(JsonField<Long> completedAt)
The Unix timestamp (in seconds) for when the run was completed. final Run.Builder
createdAt(Long createdAt)
The Unix timestamp (in seconds) for when the run was created. final Run.Builder
createdAt(JsonField<Long> createdAt)
The Unix timestamp (in seconds) for when the run was created. final Run.Builder
expiresAt(Long expiresAt)
The Unix timestamp (in seconds) for when the run will expire. final Run.Builder
expiresAt(Long expiresAt)
The Unix timestamp (in seconds) for when the run will expire. final Run.Builder
expiresAt(Optional<Long> expiresAt)
The Unix timestamp (in seconds) for when the run will expire. final Run.Builder
expiresAt(JsonField<Long> expiresAt)
The Unix timestamp (in seconds) for when the run will expire. final Run.Builder
failedAt(Long failedAt)
The Unix timestamp (in seconds) for when the run failed. final Run.Builder
failedAt(Long failedAt)
The Unix timestamp (in seconds) for when the run failed. final Run.Builder
failedAt(Optional<Long> failedAt)
The Unix timestamp (in seconds) for when the run failed. final Run.Builder
failedAt(JsonField<Long> failedAt)
The Unix timestamp (in seconds) for when the run failed. final Run.Builder
incompleteDetails(Run.IncompleteDetails incompleteDetails)
Details on why the run is incomplete. final Run.Builder
incompleteDetails(Optional<Run.IncompleteDetails> incompleteDetails)
Details on why the run is incomplete. final Run.Builder
incompleteDetails(JsonField<Run.IncompleteDetails> incompleteDetails)
Details on why the run is incomplete. final Run.Builder
instructions(String instructions)
The instructions that the assistant used for this run. final Run.Builder
instructions(JsonField<String> instructions)
The instructions that the assistant used for this run. final Run.Builder
lastError(Run.LastError lastError)
The last error associated with this run. final Run.Builder
lastError(Optional<Run.LastError> lastError)
The last error associated with this run. final Run.Builder
lastError(JsonField<Run.LastError> lastError)
The last error associated with this run. final Run.Builder
maxCompletionTokens(Long maxCompletionTokens)
The maximum number of completion tokens specified to have been used over the course of the run. final Run.Builder
maxCompletionTokens(Long maxCompletionTokens)
The maximum number of completion tokens specified to have been used over the course of the run. final Run.Builder
maxCompletionTokens(Optional<Long> maxCompletionTokens)
The maximum number of completion tokens specified to have been used over the course of the run. final Run.Builder
maxCompletionTokens(JsonField<Long> maxCompletionTokens)
The maximum number of completion tokens specified to have been used over the course of the run. final Run.Builder
maxPromptTokens(Long maxPromptTokens)
The maximum number of prompt tokens specified to have been used over the course of the run. final Run.Builder
maxPromptTokens(Long maxPromptTokens)
The maximum number of prompt tokens specified to have been used over the course of the run. final Run.Builder
maxPromptTokens(Optional<Long> maxPromptTokens)
The maximum number of prompt tokens specified to have been used over the course of the run. final Run.Builder
maxPromptTokens(JsonField<Long> maxPromptTokens)
The maximum number of prompt tokens specified to have been used over the course of the run. final Run.Builder
metadata(Metadata metadata)
Set of 16 key-value pairs that can be attached to an object. final Run.Builder
metadata(Optional<Metadata> metadata)
Set of 16 key-value pairs that can be attached to an object. final Run.Builder
metadata(JsonField<Metadata> metadata)
Set of 16 key-value pairs that can be attached to an object. final Run.Builder
model(String model)
The model that the assistant used for this run. final Run.Builder
model(JsonField<String> model)
The model that the assistant used for this run. final Run.Builder
object_(JsonValue object_)
The object type, which is always thread.run
.final Run.Builder
parallelToolCalls(Boolean parallelToolCalls)
Whether to enable parallel function calling during tool use. final Run.Builder
parallelToolCalls(JsonField<Boolean> parallelToolCalls)
Whether to enable parallel function calling during tool use. final Run.Builder
requiredAction(Run.RequiredAction requiredAction)
Details on the action required to continue the run. final Run.Builder
requiredAction(Optional<Run.RequiredAction> requiredAction)
Details on the action required to continue the run. final Run.Builder
requiredAction(JsonField<Run.RequiredAction> requiredAction)
Details on the action required to continue the run. final Run.Builder
responseFormat(AssistantResponseFormatOption responseFormat)
Specifies the format that the model must output. final Run.Builder
responseFormat(Optional<AssistantResponseFormatOption> responseFormat)
Specifies the format that the model must output. final Run.Builder
responseFormat(JsonField<AssistantResponseFormatOption> responseFormat)
Specifies the format that the model must output. final Run.Builder
responseFormat(ResponseFormatText responseFormatText)
Specifies the format that the model must output. final Run.Builder
responseFormat(ResponseFormatJsonObject responseFormatJsonObject)
Specifies the format that the model must output. final Run.Builder
responseFormat(ResponseFormatJsonSchema responseFormatJsonSchema)
Specifies the format that the model must output. final Run.Builder
responseFormatAuto()
auto
is the default valuefinal Run.Builder
startedAt(Long startedAt)
The Unix timestamp (in seconds) for when the run was started. final Run.Builder
startedAt(Long startedAt)
The Unix timestamp (in seconds) for when the run was started. final Run.Builder
startedAt(Optional<Long> startedAt)
The Unix timestamp (in seconds) for when the run was started. final Run.Builder
startedAt(JsonField<Long> startedAt)
The Unix timestamp (in seconds) for when the run was started. final Run.Builder
status(RunStatus status)
The status of the run, which can be either queued
,in_progress
,requires_action
,cancelling
,cancelled
,failed
,completed
,incomplete
, orexpired
.final Run.Builder
status(JsonField<RunStatus> status)
The status of the run, which can be either queued
,in_progress
,requires_action
,cancelling
,cancelled
,failed
,completed
,incomplete
, orexpired
.final Run.Builder
threadId(String threadId)
The ID of the thread that was executed on as a part of this run. final Run.Builder
threadId(JsonField<String> threadId)
The ID of the thread that was executed on as a part of this run. final Run.Builder
toolChoice(AssistantToolChoiceOption toolChoice)
Controls which (if any) tool is called by the model. final Run.Builder
toolChoice(Optional<AssistantToolChoiceOption> toolChoice)
Controls which (if any) tool is called by the model. final Run.Builder
toolChoice(JsonField<AssistantToolChoiceOption> toolChoice)
Controls which (if any) tool is called by the model. final Run.Builder
toolChoice(AssistantToolChoiceOption.Auto auto)
none
means the model will not call any tools and instead generates a message.final Run.Builder
toolChoice(AssistantToolChoice assistantToolChoice)
Specifies a tool the model should use. final Run.Builder
tools(List<AssistantTool> tools)
The list of tools that the assistant used for this run. final Run.Builder
tools(JsonField<List<AssistantTool>> tools)
The list of tools that the assistant used for this run. final Run.Builder
addTool(AssistantTool tool)
The list of tools that the assistant used for this run. final Run.Builder
addTool(CodeInterpreterTool codeInterpreter)
The list of tools that the assistant used for this run. final Run.Builder
addTool(FileSearchTool fileSearch)
The list of tools that the assistant used for this run. final Run.Builder
addTool(FunctionTool function)
The list of tools that the assistant used for this run. final Run.Builder
addFunctionTool(FunctionDefinition function)
The list of tools that the assistant used for this run. final Run.Builder
truncationStrategy(Run.TruncationStrategy truncationStrategy)
Controls for how a thread will be truncated prior to the run. final Run.Builder
truncationStrategy(Optional<Run.TruncationStrategy> truncationStrategy)
Controls for how a thread will be truncated prior to the run. final Run.Builder
truncationStrategy(JsonField<Run.TruncationStrategy> truncationStrategy)
Controls for how a thread will be truncated prior to the run. final Run.Builder
usage(Run.Usage usage)
Usage statistics related to the run. final Run.Builder
usage(Optional<Run.Usage> usage)
Usage statistics related to the run. final Run.Builder
usage(JsonField<Run.Usage> usage)
Usage statistics related to the run. final Run.Builder
temperature(Double temperature)
The sampling temperature used for this run. final Run.Builder
temperature(Double temperature)
The sampling temperature used for this run. final Run.Builder
temperature(Optional<Double> temperature)
The sampling temperature used for this run. final Run.Builder
temperature(JsonField<Double> temperature)
The sampling temperature used for this run. final Run.Builder
topP(Double topP)
The nucleus sampling value used for this run. final Run.Builder
topP(Double topP)
The nucleus sampling value used for this run. final Run.Builder
topP(Optional<Double> topP)
The nucleus sampling value used for this run. final Run.Builder
topP(JsonField<Double> topP)
The nucleus sampling value used for this run. final Run.Builder
additionalProperties(Map<String, JsonValue> additionalProperties)
final Run.Builder
putAdditionalProperty(String key, JsonValue value)
final Run.Builder
putAllAdditionalProperties(Map<String, JsonValue> additionalProperties)
final Run.Builder
removeAdditionalProperty(String key)
final Run.Builder
removeAllAdditionalProperties(Set<String> keys)
final Run
build()
-
-
Method Detail
-
id
final Run.Builder id(String id)
The identifier, which can be referenced in API endpoints.
-
id
final Run.Builder id(JsonField<String> id)
The identifier, which can be referenced in API endpoints.
-
assistantId
final Run.Builder assistantId(String assistantId)
The ID of the assistant used for execution of this run.
-
assistantId
final Run.Builder assistantId(JsonField<String> assistantId)
The ID of the assistant used for execution of this run.
-
cancelledAt
final Run.Builder cancelledAt(Long cancelledAt)
The Unix timestamp (in seconds) for when the run was cancelled.
-
cancelledAt
final Run.Builder cancelledAt(Long cancelledAt)
The Unix timestamp (in seconds) for when the run was cancelled.
-
cancelledAt
final Run.Builder cancelledAt(Optional<Long> cancelledAt)
The Unix timestamp (in seconds) for when the run was cancelled.
-
cancelledAt
final Run.Builder cancelledAt(JsonField<Long> cancelledAt)
The Unix timestamp (in seconds) for when the run was cancelled.
-
completedAt
final Run.Builder completedAt(Long completedAt)
The Unix timestamp (in seconds) for when the run was completed.
-
completedAt
final Run.Builder completedAt(Long completedAt)
The Unix timestamp (in seconds) for when the run was completed.
-
completedAt
final Run.Builder completedAt(Optional<Long> completedAt)
The Unix timestamp (in seconds) for when the run was completed.
-
completedAt
final Run.Builder completedAt(JsonField<Long> completedAt)
The Unix timestamp (in seconds) for when the run was completed.
-
createdAt
final Run.Builder createdAt(Long createdAt)
The Unix timestamp (in seconds) for when the run was created.
-
createdAt
final Run.Builder createdAt(JsonField<Long> createdAt)
The Unix timestamp (in seconds) for when the run was created.
-
expiresAt
final Run.Builder expiresAt(Long expiresAt)
The Unix timestamp (in seconds) for when the run will expire.
-
expiresAt
final Run.Builder expiresAt(Long expiresAt)
The Unix timestamp (in seconds) for when the run will expire.
-
expiresAt
final Run.Builder expiresAt(Optional<Long> expiresAt)
The Unix timestamp (in seconds) for when the run will expire.
-
expiresAt
final Run.Builder expiresAt(JsonField<Long> expiresAt)
The Unix timestamp (in seconds) for when the run will expire.
-
failedAt
final Run.Builder failedAt(Long failedAt)
The Unix timestamp (in seconds) for when the run failed.
-
failedAt
final Run.Builder failedAt(Long failedAt)
The Unix timestamp (in seconds) for when the run failed.
-
failedAt
final Run.Builder failedAt(Optional<Long> failedAt)
The Unix timestamp (in seconds) for when the run failed.
-
failedAt
final Run.Builder failedAt(JsonField<Long> failedAt)
The Unix timestamp (in seconds) for when the run failed.
-
incompleteDetails
final Run.Builder incompleteDetails(Run.IncompleteDetails incompleteDetails)
Details on why the run is incomplete. Will be
null
if the run is not incomplete.
-
incompleteDetails
final Run.Builder incompleteDetails(Optional<Run.IncompleteDetails> incompleteDetails)
Details on why the run is incomplete. Will be
null
if the run is not incomplete.
-
incompleteDetails
final Run.Builder incompleteDetails(JsonField<Run.IncompleteDetails> incompleteDetails)
Details on why the run is incomplete. Will be
null
if the run is not incomplete.
-
instructions
final Run.Builder instructions(String instructions)
The instructions that the assistant used for this run.
-
instructions
final Run.Builder instructions(JsonField<String> instructions)
The instructions that the assistant used for this run.
-
lastError
final Run.Builder lastError(Run.LastError lastError)
The last error associated with this run. Will be
null
if there are no errors.
-
lastError
final Run.Builder lastError(Optional<Run.LastError> lastError)
The last error associated with this run. Will be
null
if there are no errors.
-
lastError
final Run.Builder lastError(JsonField<Run.LastError> lastError)
The last error associated with this run. Will be
null
if there are no errors.
-
maxCompletionTokens
final Run.Builder maxCompletionTokens(Long maxCompletionTokens)
The maximum number of completion tokens specified to have been used over the course of the run.
-
maxCompletionTokens
final Run.Builder maxCompletionTokens(Long maxCompletionTokens)
The maximum number of completion tokens specified to have been used over the course of the run.
-
maxCompletionTokens
final Run.Builder maxCompletionTokens(Optional<Long> maxCompletionTokens)
The maximum number of completion tokens specified to have been used over the course of the run.
-
maxCompletionTokens
final Run.Builder maxCompletionTokens(JsonField<Long> maxCompletionTokens)
The maximum number of completion tokens specified to have been used over the course of the run.
-
maxPromptTokens
final Run.Builder maxPromptTokens(Long maxPromptTokens)
The maximum number of prompt tokens specified to have been used over the course of the run.
-
maxPromptTokens
final Run.Builder maxPromptTokens(Long maxPromptTokens)
The maximum number of prompt tokens specified to have been used over the course of the run.
-
maxPromptTokens
final Run.Builder maxPromptTokens(Optional<Long> maxPromptTokens)
The maximum number of prompt tokens specified to have been used over the course of the run.
-
maxPromptTokens
final Run.Builder maxPromptTokens(JsonField<Long> maxPromptTokens)
The maximum number of prompt tokens specified to have been used over the course of the run.
-
metadata
final Run.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 Run.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 Run.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.
-
model
final Run.Builder model(String model)
The model that the assistant used for this run.
-
model
final Run.Builder model(JsonField<String> model)
The model that the assistant used for this run.
-
object_
final Run.Builder object_(JsonValue object_)
The object type, which is always
thread.run
.
-
parallelToolCalls
final Run.Builder parallelToolCalls(Boolean parallelToolCalls)
Whether to enable parallel function calling during tool use.
-
parallelToolCalls
final Run.Builder parallelToolCalls(JsonField<Boolean> parallelToolCalls)
Whether to enable parallel function calling during tool use.
-
requiredAction
final Run.Builder requiredAction(Run.RequiredAction requiredAction)
Details on the action required to continue the run. Will be
null
if no action is required.
-
requiredAction
final Run.Builder requiredAction(Optional<Run.RequiredAction> requiredAction)
Details on the action required to continue the run. Will be
null
if no action is required.
-
requiredAction
final Run.Builder requiredAction(JsonField<Run.RequiredAction> requiredAction)
Details on the action required to continue the run. Will be
null
if no action is required.
-
responseFormat
final Run.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 Run.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 Run.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 Run.Builder responseFormat(ResponseFormatText responseFormatText)
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 Run.Builder responseFormat(ResponseFormatJsonObject responseFormatJsonObject)
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 Run.Builder responseFormat(ResponseFormatJsonSchema responseFormatJsonSchema)
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.
-
responseFormatAuto
final Run.Builder responseFormatAuto()
auto
is the default value
-
startedAt
final Run.Builder startedAt(Long startedAt)
The Unix timestamp (in seconds) for when the run was started.
-
startedAt
final Run.Builder startedAt(Long startedAt)
The Unix timestamp (in seconds) for when the run was started.
-
startedAt
final Run.Builder startedAt(Optional<Long> startedAt)
The Unix timestamp (in seconds) for when the run was started.
-
startedAt
final Run.Builder startedAt(JsonField<Long> startedAt)
The Unix timestamp (in seconds) for when the run was started.
-
status
final Run.Builder status(RunStatus status)
The status of the run, which can be either
queued
,in_progress
,requires_action
,cancelling
,cancelled
,failed
,completed
,incomplete
, orexpired
.
-
status
final Run.Builder status(JsonField<RunStatus> status)
The status of the run, which can be either
queued
,in_progress
,requires_action
,cancelling
,cancelled
,failed
,completed
,incomplete
, orexpired
.
-
threadId
final Run.Builder threadId(String threadId)
The ID of the thread that was executed on as a part of this run.
-
threadId
final Run.Builder threadId(JsonField<String> threadId)
The ID of the thread that was executed on as a part of this run.
-
toolChoice
final Run.Builder toolChoice(AssistantToolChoiceOption toolChoice)
Controls which (if any) tool is called by the model.
none
means the model will not call any tools and instead generates a message.auto
is the default value and 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 before responding to the user. Specifying a particular tool like{"type": "file_search"}
or{"type": "function", "function": {"name": "my_function"}}
forces the model to call that tool.
-
toolChoice
final Run.Builder toolChoice(Optional<AssistantToolChoiceOption> toolChoice)
Controls which (if any) tool is called by the model.
none
means the model will not call any tools and instead generates a message.auto
is the default value and 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 before responding to the user. Specifying a particular tool like{"type": "file_search"}
or{"type": "function", "function": {"name": "my_function"}}
forces the model to call that tool.
-
toolChoice
final Run.Builder toolChoice(JsonField<AssistantToolChoiceOption> toolChoice)
Controls which (if any) tool is called by the model.
none
means the model will not call any tools and instead generates a message.auto
is the default value and 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 before responding to the user. Specifying a particular tool like{"type": "file_search"}
or{"type": "function", "function": {"name": "my_function"}}
forces the model to call that tool.
-
toolChoice
final Run.Builder toolChoice(AssistantToolChoiceOption.Auto auto)
none
means the model will not call any tools 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 before responding to the user.
-
toolChoice
final Run.Builder toolChoice(AssistantToolChoice assistantToolChoice)
Specifies a tool the model should use. Use to force the model to call a specific tool.
-
tools
final Run.Builder tools(List<AssistantTool> tools)
The list of tools that the assistant used for this run.
-
tools
final Run.Builder tools(JsonField<List<AssistantTool>> tools)
The list of tools that the assistant used for this run.
-
addTool
final Run.Builder addTool(AssistantTool tool)
The list of tools that the assistant used for this run.
-
addTool
final Run.Builder addTool(CodeInterpreterTool codeInterpreter)
The list of tools that the assistant used for this run.
-
addTool
final Run.Builder addTool(FileSearchTool fileSearch)
The list of tools that the assistant used for this run.
-
addTool
final Run.Builder addTool(FunctionTool function)
The list of tools that the assistant used for this run.
-
addFunctionTool
final Run.Builder addFunctionTool(FunctionDefinition function)
The list of tools that the assistant used for this run.
-
truncationStrategy
final Run.Builder truncationStrategy(Run.TruncationStrategy truncationStrategy)
Controls for how a thread will be truncated prior to the run. Use this to control the intial context window of the run.
-
truncationStrategy
final Run.Builder truncationStrategy(Optional<Run.TruncationStrategy> truncationStrategy)
Controls for how a thread will be truncated prior to the run. Use this to control the intial context window of the run.
-
truncationStrategy
final Run.Builder truncationStrategy(JsonField<Run.TruncationStrategy> truncationStrategy)
Controls for how a thread will be truncated prior to the run. Use this to control the intial context window of the run.
-
usage
final Run.Builder usage(Run.Usage usage)
Usage statistics related to the run. This value will be
null
if the run is not in a terminal state (i.e.in_progress
,queued
, etc.).
-
usage
final Run.Builder usage(Optional<Run.Usage> usage)
Usage statistics related to the run. This value will be
null
if the run is not in a terminal state (i.e.in_progress
,queued
, etc.).
-
usage
final Run.Builder usage(JsonField<Run.Usage> usage)
Usage statistics related to the run. This value will be
null
if the run is not in a terminal state (i.e.in_progress
,queued
, etc.).
-
temperature
final Run.Builder temperature(Double temperature)
The sampling temperature used for this run. If not set, defaults to 1.
-
temperature
final Run.Builder temperature(Double temperature)
The sampling temperature used for this run. If not set, defaults to 1.
-
temperature
final Run.Builder temperature(Optional<Double> temperature)
The sampling temperature used for this run. If not set, defaults to 1.
-
temperature
final Run.Builder temperature(JsonField<Double> temperature)
The sampling temperature used for this run. If not set, defaults to 1.
-
topP
final Run.Builder topP(Double topP)
The nucleus sampling value used for this run. If not set, defaults to 1.
-
topP
final Run.Builder topP(Double topP)
The nucleus sampling value used for this run. If not set, defaults to 1.
-
topP
final Run.Builder topP(Optional<Double> topP)
The nucleus sampling value used for this run. If not set, defaults to 1.
-
topP
final Run.Builder topP(JsonField<Double> topP)
The nucleus sampling value used for this run. If not set, defaults to 1.
-
additionalProperties
final Run.Builder additionalProperties(Map<String, JsonValue> additionalProperties)
-
putAdditionalProperty
final Run.Builder putAdditionalProperty(String key, JsonValue value)
-
putAllAdditionalProperties
final Run.Builder putAllAdditionalProperties(Map<String, JsonValue> additionalProperties)
-
removeAdditionalProperty
final Run.Builder removeAdditionalProperty(String key)
-
removeAllAdditionalProperties
final Run.Builder removeAllAdditionalProperties(Set<String> keys)
-
-
-
-