RunObject class

Represents an execution run on a thread.

Annotations
  • @freezed

Constructors

RunObject.new({required String id, required RunObjectObject object, @JsonKey(name: 'created_at') required int createdAt, @JsonKey(name: 'thread_id') required String threadId, @JsonKey(name: 'assistant_id') required String assistantId, required RunStatus status, @JsonKey(name: 'required_action') required RunRequiredAction? requiredAction, @JsonKey(name: 'last_error') required RunLastError? lastError, @JsonKey(name: 'expires_at') required int? expiresAt, @JsonKey(name: 'started_at') required int? startedAt, @JsonKey(name: 'cancelled_at') required int? cancelledAt, @JsonKey(name: 'failed_at') required int? failedAt, @JsonKey(name: 'completed_at') required int? completedAt, @JsonKey(name: 'incomplete_details') required RunObjectIncompleteDetails? incompleteDetails, required String model, required String instructions, required List<AssistantTools> tools, required Map<String, dynamic>? metadata, required RunCompletionUsage? usage, @JsonKey(includeIfNull: false) double? temperature, @JsonKey(name: 'top_p', includeIfNull: false) double? topP, @JsonKey(name: 'max_prompt_tokens') required int? maxPromptTokens, @JsonKey(name: 'max_completion_tokens') required int? maxCompletionTokens, @JsonKey(name: 'truncation_strategy') required TruncationObject? truncationStrategy, @_RunObjectToolChoiceConverter() @JsonKey(name: 'tool_choice') required RunObjectToolChoice? toolChoice, @JsonKey(name: 'parallel_tool_calls') required bool? parallelToolCalls, @_RunObjectResponseFormatConverter() @JsonKey(name: 'response_format') required RunObjectResponseFormat responseFormat})
Factory constructor for RunObject
const
factory
RunObject.fromJson(Map<String, dynamic> json)
Object construction from a JSON representation
factory

Properties

assistantId String
The ID of the assistant used for execution of this run.
no setterinherited
cancelledAt int?
The Unix timestamp (in seconds) for when the run was cancelled.
no setterinherited
completedAt int?
The Unix timestamp (in seconds) for when the run was completed.
no setterinherited
copyWith → $RunObjectCopyWith<RunObject>
Create a copy of RunObject with the given fields replaced by the non-null parameter values.
no setterinherited
createdAt int
The Unix timestamp (in seconds) for when the run was created.
no setterinherited
expiresAt int?
The Unix timestamp (in seconds) for when the run will expire.
no setterinherited
failedAt int?
The Unix timestamp (in seconds) for when the run failed.
no setterinherited
hashCode int
The hash code for this object.
no setterinherited
id String
The identifier, which can be referenced in API endpoints.
no setterinherited
incompleteDetails RunObjectIncompleteDetails?
Details on why the run is incomplete. Will be null if the run is not incomplete.
no setterinherited
instructions String
The instructions that the assistant used for this run.
no setterinherited
lastError RunLastError?
The last error associated with this run. Will be null if there are no errors.
no setterinherited
maxCompletionTokens int?
The maximum number of completion tokens specified to have been used over the course of the run.
no setterinherited
maxPromptTokens int?
The maximum number of prompt tokens specified to have been used over the course of the run.
no setterinherited
metadata Map<String, dynamic>?
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. Keys can be a maximum of 64 characters long and values can be a maximum of 512 characters long.
no setterinherited
model String
The model that the assistant used for this run.
no setterinherited
object RunObjectObject
The object type, which is always thread.run.
no setterinherited
parallelToolCalls bool?
Whether to enable parallel function calling during tool use.
no setterinherited
requiredAction RunRequiredAction?
Details on the action required to continue the run. Will be null if no action is required.
no setterinherited
responseFormat RunObjectResponseFormat
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.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
startedAt int?
The Unix timestamp (in seconds) for when the run was started.
no setterinherited
status RunStatus
The status of the run, which can be either queued, in_progress, requires_action, cancelling, cancelled, failed, completed, incomplete, or expired.
no setterinherited
temperature double?
The sampling temperature used for this run. If not set, defaults to 1.
no setterinherited
threadId String
The ID of the thread that was executed on as a part of this run.
no setterinherited
toolChoice RunObjectToolChoice?
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.
no setterinherited
tools List<AssistantTools>
The list of tools that the assistant used for this run.
no setterinherited
topP double?
The nucleus sampling value used for this run. If not set, defaults to 1.
no setterinherited
truncationStrategy TruncationObject?
Controls for how a thread will be truncated prior to the run. Use this to control the initial context window of the run.
no setterinherited
usage RunCompletionUsage?
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.).
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() Map<String, dynamic>
Serializes this RunObject to a JSON map.
inherited
toMap() Map<String, dynamic>
Map representation of object (not serialized)
toString() String
A string representation of this object.
inherited
validateSchema() String?
Perform validations on the schema property values

Operators

operator ==(Object other) bool
The equality operator.
inherited

Constants

maxCompletionTokensMinValue → const int
maxPromptTokensMinValue → const int
Validation constants
propertyNames → const List<String>
List of all property names of schema