Class Run
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public final class
Run.Builder
A builder for Run.
public final class
Run.IncompleteDetails
Details on why the run is incomplete. Will be
null
if the run is not incomplete.public final class
Run.LastError
The last error associated with this run. Will be
null
if there are no errors.public final class
Run.RequiredAction
Details on the action required to continue the run. Will be
null
if no action is required.public final class
Run.TruncationStrategy
Controls for how a thread will be truncated prior to the run. Use this to control the intial context window of the run.
public final class
Run.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.).
-
Method Summary
Modifier and Type Method Description final String
id()
The identifier, which can be referenced in API endpoints. final String
assistantId()
The ID of the assistant used for execution of this run. final Optional<Long>
cancelledAt()
The Unix timestamp (in seconds) for when the run was cancelled. final Optional<Long>
completedAt()
The Unix timestamp (in seconds) for when the run was completed. final Long
createdAt()
The Unix timestamp (in seconds) for when the run was created. final Optional<Long>
expiresAt()
The Unix timestamp (in seconds) for when the run will expire. final Optional<Long>
failedAt()
The Unix timestamp (in seconds) for when the run failed. final Optional<Run.IncompleteDetails>
incompleteDetails()
Details on why the run is incomplete. final String
instructions()
The instructions that the assistant used for this run. final Optional<Run.LastError>
lastError()
The last error associated with this run. final Optional<Long>
maxCompletionTokens()
The maximum number of completion tokens specified to have been used over the course of the run. final Optional<Long>
maxPromptTokens()
The maximum number of prompt tokens specified to have been used over the course of the run. final Optional<Metadata>
metadata()
Set of 16 key-value pairs that can be attached to an object. final String
model()
The model that the assistant used for this run. final JsonValue
_object_()
The object type, which is always thread.run
.final Boolean
parallelToolCalls()
Whether to enable parallel function calling during tool use. final Optional<Run.RequiredAction>
requiredAction()
Details on the action required to continue the run. final Optional<AssistantResponseFormatOption>
responseFormat()
Specifies the format that the model must output. final Optional<Long>
startedAt()
The Unix timestamp (in seconds) for when the run was started. final RunStatus
status()
The status of the run, which can be either queued
,in_progress
,requires_action
,cancelling
,cancelled
,failed
,completed
,incomplete
, orexpired
.final String
threadId()
The ID of the thread that was executed on as a part of this run. final Optional<AssistantToolChoiceOption>
toolChoice()
Controls which (if any) tool is called by the model. final List<AssistantTool>
tools()
The list of tools that the assistant used for this run. final Optional<Run.TruncationStrategy>
truncationStrategy()
Controls for how a thread will be truncated prior to the run. final Optional<Run.Usage>
usage()
Usage statistics related to the run. final Optional<Double>
temperature()
The sampling temperature used for this run. final Optional<Double>
topP()
The nucleus sampling value used for this run. final JsonField<String>
_id()
The identifier, which can be referenced in API endpoints. final JsonField<String>
_assistantId()
The ID of the assistant used for execution of this run. final JsonField<Long>
_cancelledAt()
The Unix timestamp (in seconds) for when the run was cancelled. final JsonField<Long>
_completedAt()
The Unix timestamp (in seconds) for when the run was completed. final JsonField<Long>
_createdAt()
The Unix timestamp (in seconds) for when the run was created. final JsonField<Long>
_expiresAt()
The Unix timestamp (in seconds) for when the run will expire. final JsonField<Long>
_failedAt()
The Unix timestamp (in seconds) for when the run failed. final JsonField<Run.IncompleteDetails>
_incompleteDetails()
Details on why the run is incomplete. final JsonField<String>
_instructions()
The instructions that the assistant used for this run. final JsonField<Run.LastError>
_lastError()
The last error associated with this run. final JsonField<Long>
_maxCompletionTokens()
The maximum number of completion tokens specified to have been used over the course of the run. final JsonField<Long>
_maxPromptTokens()
The maximum number of prompt tokens specified to have been used over the course of the run. final JsonField<Metadata>
_metadata()
Set of 16 key-value pairs that can be attached to an object. final JsonField<String>
_model()
The model that the assistant used for this run. final JsonField<Boolean>
_parallelToolCalls()
Whether to enable parallel function calling during tool use. final JsonField<Run.RequiredAction>
_requiredAction()
Details on the action required to continue the run. final JsonField<AssistantResponseFormatOption>
_responseFormat()
Specifies the format that the model must output. final JsonField<Long>
_startedAt()
The Unix timestamp (in seconds) for when the run was started. final JsonField<RunStatus>
_status()
The status of the run, which can be either queued
,in_progress
,requires_action
,cancelling
,cancelled
,failed
,completed
,incomplete
, orexpired
.final JsonField<String>
_threadId()
The ID of the thread that was executed on as a part of this run. final JsonField<AssistantToolChoiceOption>
_toolChoice()
Controls which (if any) tool is called by the model. final JsonField<List<AssistantTool>>
_tools()
The list of tools that the assistant used for this run. final JsonField<Run.TruncationStrategy>
_truncationStrategy()
Controls for how a thread will be truncated prior to the run. final JsonField<Run.Usage>
_usage()
Usage statistics related to the run. final JsonField<Double>
_temperature()
The sampling temperature used for this run. final JsonField<Double>
_topP()
The nucleus sampling value used for this run. final Map<String, JsonValue>
_additionalProperties()
final Run
validate()
final Run.Builder
toBuilder()
Boolean
equals(Object other)
Integer
hashCode()
String
toString()
final static Run.Builder
builder()
-
-
Method Detail
-
assistantId
final String assistantId()
The ID of the assistant used for execution of this run.
-
cancelledAt
final Optional<Long> cancelledAt()
The Unix timestamp (in seconds) for when the run was cancelled.
-
completedAt
final Optional<Long> completedAt()
The Unix timestamp (in seconds) for when the run was completed.
-
expiresAt
final Optional<Long> expiresAt()
The Unix timestamp (in seconds) for when the run will expire.
-
incompleteDetails
final Optional<Run.IncompleteDetails> incompleteDetails()
Details on why the run is incomplete. Will be
null
if the run is not incomplete.
-
instructions
final String instructions()
The instructions that the assistant used for this run.
-
lastError
final Optional<Run.LastError> lastError()
The last error associated with this run. Will be
null
if there are no errors.
-
maxCompletionTokens
final Optional<Long> maxCompletionTokens()
The maximum number of completion tokens specified to have been used over the course of the run.
-
maxPromptTokens
final Optional<Long> maxPromptTokens()
The maximum number of prompt tokens specified to have been used over the course of the run.
-
metadata
final 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.
-
parallelToolCalls
final Boolean parallelToolCalls()
Whether to enable parallel function calling during tool use.
-
requiredAction
final Optional<Run.RequiredAction> requiredAction()
Details on the action required to continue the run. Will be
null
if no action is required.
-
responseFormat
final 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.
-
startedAt
final Optional<Long> startedAt()
The Unix timestamp (in seconds) for when the run was started.
-
status
final RunStatus status()
The status of the run, which can be either
queued
,in_progress
,requires_action
,cancelling
,cancelled
,failed
,completed
,incomplete
, orexpired
.
-
toolChoice
final 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.
-
tools
final List<AssistantTool> tools()
The list of tools that the assistant used for this run.
-
truncationStrategy
final 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.
-
usage
final 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.).
-
temperature
final Optional<Double> temperature()
The sampling temperature used for this run. If not set, defaults to 1.
-
topP
final Optional<Double> topP()
The nucleus sampling value used for this run. If not set, defaults to 1.
-
_assistantId
final JsonField<String> _assistantId()
The ID of the assistant used for execution of this run.
-
_cancelledAt
final JsonField<Long> _cancelledAt()
The Unix timestamp (in seconds) for when the run was cancelled.
-
_completedAt
final JsonField<Long> _completedAt()
The Unix timestamp (in seconds) for when the run was completed.
-
_createdAt
final JsonField<Long> _createdAt()
The Unix timestamp (in seconds) for when the run was created.
-
_expiresAt
final JsonField<Long> _expiresAt()
The Unix timestamp (in seconds) for when the run will expire.
-
_failedAt
final JsonField<Long> _failedAt()
The Unix timestamp (in seconds) for when the run failed.
-
_incompleteDetails
final JsonField<Run.IncompleteDetails> _incompleteDetails()
Details on why the run is incomplete. Will be
null
if the run is not incomplete.
-
_instructions
final JsonField<String> _instructions()
The instructions that the assistant used for this run.
-
_lastError
final JsonField<Run.LastError> _lastError()
The last error associated with this run. Will be
null
if there are no errors.
-
_maxCompletionTokens
final JsonField<Long> _maxCompletionTokens()
The maximum number of completion tokens specified to have been used over the course of the run.
-
_maxPromptTokens
final JsonField<Long> _maxPromptTokens()
The maximum number of prompt tokens specified to have been used over the course of the run.
-
_metadata
final 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 JsonField<Boolean> _parallelToolCalls()
Whether to enable parallel function calling during tool use.
-
_requiredAction
final JsonField<Run.RequiredAction> _requiredAction()
Details on the action required to continue the run. Will be
null
if no action is required.
-
_responseFormat
final 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.
-
_startedAt
final JsonField<Long> _startedAt()
The Unix timestamp (in seconds) for when the run was started.
-
_status
final 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 JsonField<String> _threadId()
The ID of the thread that was executed on as a part of this run.
-
_toolChoice
final 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.
-
_tools
final JsonField<List<AssistantTool>> _tools()
The list of tools that the assistant used for this run.
-
_truncationStrategy
final 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 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 JsonField<Double> _temperature()
The sampling temperature used for this run. If not set, defaults to 1.
-
_topP
final JsonField<Double> _topP()
The nucleus sampling value used for this run. If not set, defaults to 1.
-
_additionalProperties
final Map<String, JsonValue> _additionalProperties()
-
toBuilder
final Run.Builder toBuilder()
-
builder
final static Run.Builder builder()
-
-
-
-