class

OpenAI::RunObject

Inherits JSON::Serializable < Reference < Object

Represents an execution run on a thread.

Constructors

new(id : String = "", object : RunObjectObject = RunObjectObject::ThreadRun, created_at : Int64 = 0, thread_id : String = "", assistant_id : String = "", status : RunStatus = RunStatus::Queued, required_action : RunObjectRequiredAction | Nil = nil, last_error : RunObjectLastError | Nil = nil, expires_at : Int64 | Nil = nil, started_at : Int64 | Nil = nil, cancelled_at : Int64 | Nil = nil, failed_at : Int64 | Nil = nil, completed_at : Int64 | Nil = nil, incomplete_details : RunObjectIncompleteDetails | Nil = nil, model : String = "", instructions : String = "", tools : Array(AssistantTool) = [] of AssistantTool, metadata : Metadata = nil, usage : RunCompletionUsage = nil, temperature : Float64 | Nil = nil, top_p : Float64 | Nil = nil, max_prompt_tokens : Int64 | Nil = nil, max_completion_tokens : Int64 | Nil = nil, truncation_strategy : RunObjectTruncationStrategy = RunObjectTruncationStrategy.new, tool_choice : RunObjectToolChoice = RunObjectToolChoice.new, parallel_tool_calls : ParallelToolCalls = ParallelToolCalls.new, response_format : AssistantsApiResponseFormatOption | Nil = nil)
Source
new(*, __pull_for_json_serializable pull : JSON::PullParser)
Source

Instance methods

assistant_id

The ID of the assistant used for execution of this run.

Source
assistant_id=(assistant_id : String)

The ID of the assistant used for execution of this run.

Source
cancelled_at

The Unix timestamp (in seconds) for when the run was cancelled.

Source
cancelled_at=(cancelled_at : Int64 | Nil)

The Unix timestamp (in seconds) for when the run was cancelled.

Source
completed_at

The Unix timestamp (in seconds) for when the run was completed.

Source
completed_at=(completed_at : Int64 | Nil)

The Unix timestamp (in seconds) for when the run was completed.

Source
created_at

The Unix timestamp (in seconds) for when the run was created.

Source
created_at=(created_at : Int64)

The Unix timestamp (in seconds) for when the run was created.

Source
expires_at

The Unix timestamp (in seconds) for when the run will expire.

Source
expires_at=(expires_at : Int64 | Nil)

The Unix timestamp (in seconds) for when the run will expire.

Source
failed_at

The Unix timestamp (in seconds) for when the run failed.

Source
failed_at=(failed_at : Int64 | Nil)

The Unix timestamp (in seconds) for when the run failed.

Source
id

The identifier, which can be referenced in API endpoints.

Source
id=(id : String)

The identifier, which can be referenced in API endpoints.

Source
incomplete_details

Details on why the run is incomplete. Will be null if the run is not incomplete.

Source
incomplete_details=(incomplete_details : RunObjectIncompleteDetails | Nil)

Details on why the run is incomplete. Will be null if the run is not incomplete.

Source
instructions

The instructions that the assistant used for this run.

Source
instructions=(instructions : String)

The instructions that the assistant used for this run.

Source
last_error

The last error associated with this run. Will be null if there are no errors.

Source
last_error=(last_error : RunObjectLastError | Nil)

The last error associated with this run. Will be null if there are no errors.

Source
max_completion_tokens

The maximum number of completion tokens specified to have been used over the course of the run.

Source
max_completion_tokens=(max_completion_tokens : Int64 | Nil)

The maximum number of completion tokens specified to have been used over the course of the run.

Source
max_prompt_tokens

The maximum number of prompt tokens specified to have been used over the course of the run.

Source
max_prompt_tokens=(max_prompt_tokens : Int64 | Nil)

The maximum number of prompt tokens specified to have been used over the course of the run.

Source
metadata
Source
metadata=(metadata : Metadata)
Source
model

The model that the assistant used for this run.

Source
model=(model : String)

The model that the assistant used for this run.

Source
object

The object type, which is always thread.run.

Source
object=(object : RunObjectObject)

The object type, which is always thread.run.

Source
parallel_tool_calls
Source
parallel_tool_calls=(parallel_tool_calls : ParallelToolCalls)
Source
required_action

Details on the action required to continue the run. Will be null if no action is required.

Source
required_action=(required_action : RunObjectRequiredAction | Nil)

Details on the action required to continue the run. Will be null if no action is required.

Source
response_format
Source
response_format=(response_format : AssistantsApiResponseFormatOption | Nil)
Source
started_at

The Unix timestamp (in seconds) for when the run was started.

Source
started_at=(started_at : Int64 | Nil)

The Unix timestamp (in seconds) for when the run was started.

Source
status
Source
status=(status : RunStatus)
Source
temperature

The sampling temperature used for this run. If not set, defaults to 1.

Source
temperature=(temperature : Float64 | Nil)

The sampling temperature used for this run. If not set, defaults to 1.

Source
thread_id

The ID of the thread that was executed on as a part of this run.

Source
thread_id=(thread_id : String)

The ID of the thread that was executed on as a part of this run.

Source
tool_choice
Source
tool_choice=(tool_choice : RunObjectToolChoice)
Source
tools

The list of tools that the assistant used for this run.

Source
tools=(tools : Array(AssistantTool))

The list of tools that the assistant used for this run.

Source
top_p

The nucleus sampling value used for this run. If not set, defaults to 1.

Source
top_p=(top_p : Float64 | Nil)

The nucleus sampling value used for this run. If not set, defaults to 1.

Source
truncation_strategy
Source
truncation_strategy=(truncation_strategy : RunObjectTruncationStrategy)
Source
usage
Source
usage=(usage : RunCompletionUsage)
Source
validate!
Source