Class Run.Builder
-
- All Implemented Interfaces:
public final class Run.BuilderA builder for Run.
-
-
Method Summary
Modifier and Type Method Description final Run.Builderid(String id)The identifier, which can be referenced in API endpoints. final Run.Builderid(JsonField<String> id)Sets Builder.id to an arbitrary JSON value. final Run.BuilderassistantId(String assistantId)The ID of the assistant used for execution of this run. final Run.BuilderassistantId(JsonField<String> assistantId)Sets Builder.assistantId to an arbitrary JSON value. final Run.BuildercancelledAt(Long cancelledAt)The Unix timestamp (in seconds) for when the run was cancelled. final Run.BuildercancelledAt(Long cancelledAt)Alias for Builder.cancelledAt. final Run.BuildercancelledAt(Optional<Long> cancelledAt)Alias for calling Builder.cancelledAt with cancelledAt.orElse(null).final Run.BuildercancelledAt(JsonField<Long> cancelledAt)Sets Builder.cancelledAt to an arbitrary JSON value. final Run.BuildercompletedAt(Long completedAt)The Unix timestamp (in seconds) for when the run was completed. final Run.BuildercompletedAt(Long completedAt)Alias for Builder.completedAt. final Run.BuildercompletedAt(Optional<Long> completedAt)Alias for calling Builder.completedAt with completedAt.orElse(null).final Run.BuildercompletedAt(JsonField<Long> completedAt)Sets Builder.completedAt to an arbitrary JSON value. final Run.BuildercreatedAt(Long createdAt)The Unix timestamp (in seconds) for when the run was created. final Run.BuildercreatedAt(JsonField<Long> createdAt)Sets Builder.createdAt to an arbitrary JSON value. final Run.BuilderexpiresAt(Long expiresAt)The Unix timestamp (in seconds) for when the run will expire. final Run.BuilderexpiresAt(Long expiresAt)Alias for Builder.expiresAt. final Run.BuilderexpiresAt(Optional<Long> expiresAt)Alias for calling Builder.expiresAt with expiresAt.orElse(null).final Run.BuilderexpiresAt(JsonField<Long> expiresAt)Sets Builder.expiresAt to an arbitrary JSON value. final Run.BuilderfailedAt(Long failedAt)The Unix timestamp (in seconds) for when the run failed. final Run.BuilderfailedAt(Long failedAt)Alias for Builder.failedAt. final Run.BuilderfailedAt(Optional<Long> failedAt)Alias for calling Builder.failedAt with failedAt.orElse(null).final Run.BuilderfailedAt(JsonField<Long> failedAt)Sets Builder.failedAt to an arbitrary JSON value. final Run.BuilderincompleteDetails(Run.IncompleteDetails incompleteDetails)Details on why the run is incomplete. final Run.BuilderincompleteDetails(Optional<Run.IncompleteDetails> incompleteDetails)Alias for calling Builder.incompleteDetails with incompleteDetails.orElse(null).final Run.BuilderincompleteDetails(JsonField<Run.IncompleteDetails> incompleteDetails)Sets Builder.incompleteDetails to an arbitrary JSON value. final Run.Builderinstructions(String instructions)The instructions that the assistant used for this run. final Run.Builderinstructions(JsonField<String> instructions)Sets Builder.instructions to an arbitrary JSON value. final Run.BuilderlastError(Run.LastError lastError)The last error associated with this run. final Run.BuilderlastError(Optional<Run.LastError> lastError)Alias for calling Builder.lastError with lastError.orElse(null).final Run.BuilderlastError(JsonField<Run.LastError> lastError)Sets Builder.lastError to an arbitrary JSON value. final Run.BuildermaxCompletionTokens(Long maxCompletionTokens)The maximum number of completion tokens specified to have been used over the course of the run. final Run.BuildermaxCompletionTokens(Long maxCompletionTokens)Alias for Builder.maxCompletionTokens. final Run.BuildermaxCompletionTokens(Optional<Long> maxCompletionTokens)Alias for calling Builder.maxCompletionTokens with maxCompletionTokens.orElse(null).final Run.BuildermaxCompletionTokens(JsonField<Long> maxCompletionTokens)Sets Builder.maxCompletionTokens to an arbitrary JSON value. final Run.BuildermaxPromptTokens(Long maxPromptTokens)The maximum number of prompt tokens specified to have been used over the course of the run. final Run.BuildermaxPromptTokens(Long maxPromptTokens)Alias for Builder.maxPromptTokens. final Run.BuildermaxPromptTokens(Optional<Long> maxPromptTokens)Alias for calling Builder.maxPromptTokens with maxPromptTokens.orElse(null).final Run.BuildermaxPromptTokens(JsonField<Long> maxPromptTokens)Sets Builder.maxPromptTokens to an arbitrary JSON value. final Run.Buildermetadata(Run.Metadata metadata)Set of 16 key-value pairs that can be attached to an object. final Run.Buildermetadata(Optional<Run.Metadata> metadata)Alias for calling Builder.metadata with metadata.orElse(null).final Run.Buildermetadata(JsonField<Run.Metadata> metadata)Sets Builder.metadata to an arbitrary JSON value. final Run.Buildermodel(String model)The model that the assistant used for this run. final Run.Buildermodel(JsonField<String> model)Sets Builder.model to an arbitrary JSON value. final Run.Builderobject_(JsonValue object_)Sets the field to an arbitrary JSON value. final Run.BuilderparallelToolCalls(Boolean parallelToolCalls)Whether to enable parallel function calling during tool use. final Run.BuilderparallelToolCalls(JsonField<Boolean> parallelToolCalls)Sets Builder.parallelToolCalls to an arbitrary JSON value. final Run.BuilderrequiredAction(Run.RequiredAction requiredAction)Details on the action required to continue the run. final Run.BuilderrequiredAction(Optional<Run.RequiredAction> requiredAction)Alias for calling Builder.requiredAction with requiredAction.orElse(null).final Run.BuilderrequiredAction(JsonField<Run.RequiredAction> requiredAction)Sets Builder.requiredAction to an arbitrary JSON value. final Run.BuilderresponseFormat(AssistantResponseFormatOption responseFormat)Specifies the format that the model must output. final Run.BuilderresponseFormat(Optional<AssistantResponseFormatOption> responseFormat)Alias for calling Builder.responseFormat with responseFormat.orElse(null).final Run.BuilderresponseFormat(JsonField<AssistantResponseFormatOption> responseFormat)Sets Builder.responseFormat to an arbitrary JSON value. final Run.BuilderresponseFormat(ResponseFormatText responseFormatText)Alias for calling responseFormat with AssistantResponseFormatOption.ofResponseFormatText(responseFormatText).final Run.BuilderresponseFormat(ResponseFormatJsonObject responseFormatJsonObject)Alias for calling responseFormat with AssistantResponseFormatOption.ofResponseFormatJsonObject(responseFormatJsonObject).final Run.BuilderresponseFormat(ResponseFormatJsonSchema responseFormatJsonSchema)Alias for calling responseFormat with AssistantResponseFormatOption.ofResponseFormatJsonSchema(responseFormatJsonSchema).final Run.BuilderresponseFormatAuto()Alias for calling responseFormat with AssistantResponseFormatOption.ofAuto().final Run.BuilderstartedAt(Long startedAt)The Unix timestamp (in seconds) for when the run was started. final Run.BuilderstartedAt(Long startedAt)Alias for Builder.startedAt. final Run.BuilderstartedAt(Optional<Long> startedAt)Alias for calling Builder.startedAt with startedAt.orElse(null).final Run.BuilderstartedAt(JsonField<Long> startedAt)Sets Builder.startedAt to an arbitrary JSON value. final Run.Builderstatus(RunStatus status)The status of the run, which can be either queued,in_progress,requires_action,cancelling,cancelled,failed,completed,incomplete, orexpired.final Run.Builderstatus(JsonField<RunStatus> status)Sets Builder.status to an arbitrary JSON value. final Run.BuilderthreadId(String threadId)The ID of the thread that was executed on as a part of this run. final Run.BuilderthreadId(JsonField<String> threadId)Sets Builder.threadId to an arbitrary JSON value. final Run.BuildertoolChoice(AssistantToolChoiceOption toolChoice)Controls which (if any) tool is called by the model. final Run.BuildertoolChoice(Optional<AssistantToolChoiceOption> toolChoice)Alias for calling Builder.toolChoice with toolChoice.orElse(null).final Run.BuildertoolChoice(JsonField<AssistantToolChoiceOption> toolChoice)Sets Builder.toolChoice to an arbitrary JSON value. final Run.BuildertoolChoice(AssistantToolChoiceOption.Auto auto)Alias for calling toolChoice with AssistantToolChoiceOption.ofAuto(auto).final Run.BuildertoolChoice(AssistantToolChoice assistantToolChoice)Alias for calling toolChoice with AssistantToolChoiceOption.ofAssistantToolChoice(assistantToolChoice).final Run.Buildertools(List<AssistantTool> tools)The list of tools that the assistant used for this run. final Run.Buildertools(JsonField<List<AssistantTool>> tools)Sets Builder.tools to an arbitrary JSON value. final Run.BuilderaddTool(AssistantTool tool)Adds a single AssistantTool to tools. final Run.BuilderaddTool(CodeInterpreterTool codeInterpreter)Alias for calling addTool with AssistantTool.ofCodeInterpreter(codeInterpreter).final Run.BuilderaddTool(FileSearchTool fileSearch)Alias for calling addTool with AssistantTool.ofFileSearch(fileSearch).final Run.BuilderaddTool(FunctionTool function)Alias for calling addTool with AssistantTool.ofFunction(function).final Run.BuilderaddFunctionTool(FunctionDefinition function)Alias for calling addTool with the following: FunctionTool.builder() .function(function) .build()final Run.BuildertruncationStrategy(Run.TruncationStrategy truncationStrategy)Controls for how a thread will be truncated prior to the run. final Run.BuildertruncationStrategy(Optional<Run.TruncationStrategy> truncationStrategy)Alias for calling Builder.truncationStrategy with truncationStrategy.orElse(null).final Run.BuildertruncationStrategy(JsonField<Run.TruncationStrategy> truncationStrategy)Sets Builder.truncationStrategy to an arbitrary JSON value. final Run.Builderusage(Run.Usage usage)Usage statistics related to the run. final Run.Builderusage(Optional<Run.Usage> usage)Alias for calling Builder.usage with usage.orElse(null).final Run.Builderusage(JsonField<Run.Usage> usage)Sets Builder.usage to an arbitrary JSON value. final Run.Buildertemperature(Double temperature)The sampling temperature used for this run. final Run.Buildertemperature(Double temperature)Alias for Builder.temperature. final Run.Buildertemperature(Optional<Double> temperature)Alias for calling Builder.temperature with temperature.orElse(null).final Run.Buildertemperature(JsonField<Double> temperature)Sets Builder.temperature to an arbitrary JSON value. final Run.BuildertopP(Double topP)The nucleus sampling value used for this run. final Run.BuildertopP(Double topP)Alias for Builder.topP. final Run.BuildertopP(Optional<Double> topP)Alias for calling Builder.topP with topP.orElse(null).final Run.BuildertopP(JsonField<Double> topP)Sets Builder.topP to an arbitrary JSON value. final Run.BuilderadditionalProperties(Map<String, JsonValue> additionalProperties)final Run.BuilderputAdditionalProperty(String key, JsonValue value)final Run.BuilderputAllAdditionalProperties(Map<String, JsonValue> additionalProperties)final Run.BuilderremoveAdditionalProperty(String key)final Run.BuilderremoveAllAdditionalProperties(Set<String> keys)final Runbuild()Returns an immutable instance of Run. -
-
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)
Sets Builder.id to an arbitrary JSON value.
You should usually call Builder.id with a well-typed String value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
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)
Sets Builder.assistantId to an arbitrary JSON value.
You should usually call Builder.assistantId with a well-typed String value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
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)
Alias for Builder.cancelledAt.
This unboxed primitive overload exists for backwards compatibility.
-
cancelledAt
final Run.Builder cancelledAt(Optional<Long> cancelledAt)
Alias for calling Builder.cancelledAt with
cancelledAt.orElse(null).
-
cancelledAt
final Run.Builder cancelledAt(JsonField<Long> cancelledAt)
Sets Builder.cancelledAt to an arbitrary JSON value.
You should usually call Builder.cancelledAt with a well-typed Long value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
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)
Alias for Builder.completedAt.
This unboxed primitive overload exists for backwards compatibility.
-
completedAt
final Run.Builder completedAt(Optional<Long> completedAt)
Alias for calling Builder.completedAt with
completedAt.orElse(null).
-
completedAt
final Run.Builder completedAt(JsonField<Long> completedAt)
Sets Builder.completedAt to an arbitrary JSON value.
You should usually call Builder.completedAt with a well-typed Long value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
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)
Sets Builder.createdAt to an arbitrary JSON value.
You should usually call Builder.createdAt with a well-typed Long value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
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)
Alias for Builder.expiresAt.
This unboxed primitive overload exists for backwards compatibility.
-
expiresAt
final Run.Builder expiresAt(Optional<Long> expiresAt)
Alias for calling Builder.expiresAt with
expiresAt.orElse(null).
-
expiresAt
final Run.Builder expiresAt(JsonField<Long> expiresAt)
Sets Builder.expiresAt to an arbitrary JSON value.
You should usually call Builder.expiresAt with a well-typed Long value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
failedAt
final Run.Builder failedAt(Long failedAt)
The Unix timestamp (in seconds) for when the run failed.
-
failedAt
final Run.Builder failedAt(Long failedAt)
Alias for Builder.failedAt.
This unboxed primitive overload exists for backwards compatibility.
-
failedAt
final Run.Builder failedAt(Optional<Long> failedAt)
Alias for calling Builder.failedAt with
failedAt.orElse(null).
-
failedAt
final Run.Builder failedAt(JsonField<Long> failedAt)
Sets Builder.failedAt to an arbitrary JSON value.
You should usually call Builder.failedAt with a well-typed Long value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
incompleteDetails
final Run.Builder incompleteDetails(Run.IncompleteDetails incompleteDetails)
Details on why the run is incomplete. Will be
nullif the run is not incomplete.
-
incompleteDetails
final Run.Builder incompleteDetails(Optional<Run.IncompleteDetails> incompleteDetails)
Alias for calling Builder.incompleteDetails with
incompleteDetails.orElse(null).
-
incompleteDetails
final Run.Builder incompleteDetails(JsonField<Run.IncompleteDetails> incompleteDetails)
Sets Builder.incompleteDetails to an arbitrary JSON value.
You should usually call Builder.incompleteDetails with a well-typed IncompleteDetails value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
instructions
final Run.Builder instructions(String instructions)
The instructions that the assistant used for this run.
-
instructions
final Run.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.
-
lastError
final Run.Builder lastError(Run.LastError lastError)
The last error associated with this run. Will be
nullif there are no errors.
-
lastError
final Run.Builder lastError(Optional<Run.LastError> lastError)
Alias for calling Builder.lastError with
lastError.orElse(null).
-
lastError
final Run.Builder lastError(JsonField<Run.LastError> lastError)
Sets Builder.lastError to an arbitrary JSON value.
You should usually call Builder.lastError with a well-typed LastError value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
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)
Alias for Builder.maxCompletionTokens.
This unboxed primitive overload exists for backwards compatibility.
-
maxCompletionTokens
final Run.Builder maxCompletionTokens(Optional<Long> maxCompletionTokens)
Alias for calling Builder.maxCompletionTokens with
maxCompletionTokens.orElse(null).
-
maxCompletionTokens
final Run.Builder maxCompletionTokens(JsonField<Long> maxCompletionTokens)
Sets Builder.maxCompletionTokens to an arbitrary JSON value.
You should usually call Builder.maxCompletionTokens with a well-typed Long value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
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)
Alias for Builder.maxPromptTokens.
This unboxed primitive overload exists for backwards compatibility.
-
maxPromptTokens
final Run.Builder maxPromptTokens(Optional<Long> maxPromptTokens)
Alias for calling Builder.maxPromptTokens with
maxPromptTokens.orElse(null).
-
maxPromptTokens
final Run.Builder maxPromptTokens(JsonField<Long> maxPromptTokens)
Sets Builder.maxPromptTokens to an arbitrary JSON value.
You should usually call Builder.maxPromptTokens 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 Run.Builder metadata(Run.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<Run.Metadata> metadata)
Alias for calling Builder.metadata with
metadata.orElse(null).
-
metadata
final Run.Builder metadata(JsonField<Run.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 Run.Builder model(String model)
The model that the assistant used for this run.
-
model
final Run.Builder model(JsonField<String> model)
Sets Builder.model to an arbitrary JSON value.
You should usually call Builder.model with a well-typed String value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
object_
final Run.Builder object_(JsonValue object_)
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("thread.run")This method is primarily for setting the field to an undocumented or not yet supported value.
-
parallelToolCalls
final Run.Builder parallelToolCalls(Boolean parallelToolCalls)
Whether to enable parallel function calling during tool use.
-
parallelToolCalls
final Run.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.
-
requiredAction
final Run.Builder requiredAction(Run.RequiredAction requiredAction)
Details on the action required to continue the run. Will be
nullif no action is required.
-
requiredAction
final Run.Builder requiredAction(Optional<Run.RequiredAction> requiredAction)
Alias for calling Builder.requiredAction with
requiredAction.orElse(null).
-
requiredAction
final Run.Builder requiredAction(JsonField<Run.RequiredAction> requiredAction)
Sets Builder.requiredAction to an arbitrary JSON value.
You should usually call Builder.requiredAction with a well-typed RequiredAction value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
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_tokensor the conversation exceeded the max context length.
-
responseFormat
final Run.Builder responseFormat(Optional<AssistantResponseFormatOption> responseFormat)
Alias for calling Builder.responseFormat with
responseFormat.orElse(null).
-
responseFormat
final Run.Builder responseFormat(JsonField<AssistantResponseFormatOption> responseFormat)
Sets Builder.responseFormat to an arbitrary JSON value.
You should usually call Builder.responseFormat with a well-typed AssistantResponseFormatOption value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
responseFormat
final Run.Builder responseFormat(ResponseFormatText responseFormatText)
Alias for calling responseFormat with
AssistantResponseFormatOption.ofResponseFormatText(responseFormatText).
-
responseFormat
final Run.Builder responseFormat(ResponseFormatJsonObject responseFormatJsonObject)
Alias for calling responseFormat with
AssistantResponseFormatOption.ofResponseFormatJsonObject(responseFormatJsonObject).
-
responseFormat
final Run.Builder responseFormat(ResponseFormatJsonSchema responseFormatJsonSchema)
Alias for calling responseFormat with
AssistantResponseFormatOption.ofResponseFormatJsonSchema(responseFormatJsonSchema).
-
responseFormatAuto
final Run.Builder responseFormatAuto()
Alias for calling responseFormat with
AssistantResponseFormatOption.ofAuto().
-
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)
Alias for Builder.startedAt.
This unboxed primitive overload exists for backwards compatibility.
-
startedAt
final Run.Builder startedAt(Optional<Long> startedAt)
Alias for calling Builder.startedAt with
startedAt.orElse(null).
-
startedAt
final Run.Builder startedAt(JsonField<Long> startedAt)
Sets Builder.startedAt to an arbitrary JSON value.
You should usually call Builder.startedAt with a well-typed Long value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
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)
Sets Builder.status to an arbitrary JSON value.
You should usually call Builder.status with a well-typed RunStatus value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
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)
Sets Builder.threadId to an arbitrary JSON value.
You should usually call Builder.threadId with a well-typed String value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
toolChoice
final Run.Builder toolChoice(AssistantToolChoiceOption toolChoice)
Controls which (if any) tool is called by the model.
nonemeans the model will not call any tools and instead generates a message.autois the default value and means the model can pick between generating a message or calling one or more tools.requiredmeans 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)
Alias for calling Builder.toolChoice with
toolChoice.orElse(null).
-
toolChoice
final Run.Builder toolChoice(JsonField<AssistantToolChoiceOption> toolChoice)
Sets Builder.toolChoice to an arbitrary JSON value.
You should usually call Builder.toolChoice with a well-typed AssistantToolChoiceOption value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
toolChoice
final Run.Builder toolChoice(AssistantToolChoiceOption.Auto auto)
Alias for calling toolChoice with
AssistantToolChoiceOption.ofAuto(auto).
-
toolChoice
final Run.Builder toolChoice(AssistantToolChoice assistantToolChoice)
Alias for calling toolChoice with
AssistantToolChoiceOption.ofAssistantToolChoice(assistantToolChoice).
-
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)
Sets Builder.tools to an arbitrary JSON value.
You should usually call Builder.tools with a well-typed
List<AssistantTool>value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
addTool
final Run.Builder addTool(AssistantTool tool)
Adds a single AssistantTool to tools.
-
addTool
final Run.Builder addTool(CodeInterpreterTool codeInterpreter)
Alias for calling addTool with
AssistantTool.ofCodeInterpreter(codeInterpreter).
-
addTool
final Run.Builder addTool(FileSearchTool fileSearch)
Alias for calling addTool with
AssistantTool.ofFileSearch(fileSearch).
-
addTool
final Run.Builder addTool(FunctionTool function)
Alias for calling addTool with
AssistantTool.ofFunction(function).
-
addFunctionTool
final Run.Builder addFunctionTool(FunctionDefinition function)
Alias for calling addTool with the following:
FunctionTool.builder() .function(function) .build()
-
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 initial context window of the run.
-
truncationStrategy
final Run.Builder truncationStrategy(Optional<Run.TruncationStrategy> truncationStrategy)
Alias for calling Builder.truncationStrategy with
truncationStrategy.orElse(null).
-
truncationStrategy
final Run.Builder truncationStrategy(JsonField<Run.TruncationStrategy> truncationStrategy)
Sets Builder.truncationStrategy to an arbitrary JSON value.
You should usually call Builder.truncationStrategy with a well-typed TruncationStrategy value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
usage
final Run.Builder usage(Run.Usage usage)
Usage statistics related to the run. This value will be
nullif the run is not in a terminal state (i.e.in_progress,queued, etc.).
-
usage
final Run.Builder usage(Optional<Run.Usage> usage)
Alias for calling Builder.usage with
usage.orElse(null).
-
usage
final Run.Builder usage(JsonField<Run.Usage> usage)
Sets Builder.usage to an arbitrary JSON value.
You should usually call Builder.usage with a well-typed Usage value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
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)
Alias for Builder.temperature.
This unboxed primitive overload exists for backwards compatibility.
-
temperature
final Run.Builder temperature(Optional<Double> temperature)
Alias for calling Builder.temperature with
temperature.orElse(null).
-
temperature
final Run.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.
-
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)
Alias for Builder.topP.
This unboxed primitive overload exists for backwards compatibility.
-
topP
final Run.Builder topP(Optional<Double> topP)
Alias for calling Builder.topP with
topP.orElse(null).
-
topP
final Run.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.
-
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)
-
build
final Run build()
Returns an immutable instance of Run.
Further updates to this Builder will not mutate the returned instance.
The following fields are required:
.id() .assistantId() .cancelledAt() .completedAt() .createdAt() .expiresAt() .failedAt() .incompleteDetails() .instructions() .lastError() .maxCompletionTokens() .maxPromptTokens() .metadata() .model() .parallelToolCalls() .requiredAction() .responseFormat() .startedAt() .status() .threadId() .toolChoice() .tools() .truncationStrategy() .usage()
-
-
-
-