run
Classes:
Name | Description |
---|---|
LastError |
|
RequiredAction |
|
RequiredActionSubmitToolOutputs |
|
Run |
|
Usage |
|
LastError
Attributes:
Name | Type | Description |
---|---|---|
code |
Literal['server_error', 'rate_limit_exceeded', 'invalid_prompt']
|
One of |
message |
str
|
A human-readable description of the error. |
code
instance-attribute
One of server_error
, rate_limit_exceeded
, or invalid_prompt
.
RequiredAction
Attributes:
Name | Type | Description |
---|---|---|
submit_tool_outputs |
RequiredActionSubmitToolOutputs
|
Details on the tool outputs needed for this run to continue. |
type |
Literal['submit_tool_outputs']
|
For now, this is always |
submit_tool_outputs
instance-attribute
submit_tool_outputs: RequiredActionSubmitToolOutputs
Details on the tool outputs needed for this run to continue.
RequiredActionSubmitToolOutputs
Attributes:
Name | Type | Description |
---|---|---|
tool_calls |
List[RequiredActionFunctionToolCall]
|
A list of the relevant tool calls. |
tool_calls
instance-attribute
tool_calls: List[RequiredActionFunctionToolCall]
A list of the relevant tool calls.
Run
Attributes:
Name | Type | Description |
---|---|---|
assistant_id |
str
|
The ID of the |
cancelled_at |
Optional[int]
|
The Unix timestamp (in seconds) for when the run was cancelled. |
completed_at |
Optional[int]
|
The Unix timestamp (in seconds) for when the run was completed. |
created_at |
int
|
The Unix timestamp (in seconds) for when the run was created. |
expires_at |
Optional[int]
|
The Unix timestamp (in seconds) for when the run will expire. |
failed_at |
Optional[int]
|
The Unix timestamp (in seconds) for when the run failed. |
file_ids |
List[str]
|
The list of File IDs the |
id |
str
|
The identifier, which can be referenced in API endpoints. |
instructions |
str
|
The instructions that the |
last_error |
Optional[LastError]
|
The last error associated with this run. Will be |
metadata |
Optional[object]
|
Set of 16 key-value pairs that can be attached to an object. |
model |
str
|
The model that the |
object |
Literal['thread.run']
|
The object type, which is always |
required_action |
Optional[RequiredAction]
|
Details on the action required to continue the run. |
started_at |
Optional[int]
|
The Unix timestamp (in seconds) for when the run was started. |
status |
RunStatus
|
The status of the run, which can be either |
thread_id |
str
|
The ID of the thread |
tools |
List[AssistantTool]
|
The list of tools that the |
usage |
Optional[Usage]
|
Usage statistics related to the run. |
assistant_id
instance-attribute
assistant_id: str
The ID of the assistant used for execution of this run.
cancelled_at
class-attribute
instance-attribute
The Unix timestamp (in seconds) for when the run was cancelled.
completed_at
class-attribute
instance-attribute
The Unix timestamp (in seconds) for when the run was completed.
created_at
instance-attribute
created_at: int
The Unix timestamp (in seconds) for when the run was created.
expires_at
class-attribute
instance-attribute
The Unix timestamp (in seconds) for when the run will expire.
failed_at
class-attribute
instance-attribute
The Unix timestamp (in seconds) for when the run failed.
file_ids
instance-attribute
instructions
instance-attribute
instructions: str
The instructions that the assistant used for this run.
last_error
class-attribute
instance-attribute
The last error associated with this run. Will be null
if there are no errors.
metadata
class-attribute
instance-attribute
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 maxium of 512 characters long.
object
instance-attribute
The object type, which is always thread.run
.
required_action
class-attribute
instance-attribute
required_action: Optional[RequiredAction] = None
Details on the action required to continue the run.
Will be null
if no action is required.
started_at
class-attribute
instance-attribute
The Unix timestamp (in seconds) for when the run was started.
status
instance-attribute
status: RunStatus
The status of the run, which can be either queued
, in_progress
,
requires_action
, cancelling
, cancelled
, failed
, completed
, or
expired
.
thread_id
instance-attribute
thread_id: str
The ID of the thread that was executed on as a part of this run.
tools
instance-attribute
tools: List[AssistantTool]
The list of tools that the assistant used for this run.
Usage
Attributes:
Name | Type | Description |
---|---|---|
completion_tokens |
int
|
Number of completion tokens used over the course of the run. |
prompt_tokens |
int
|
Number of prompt tokens used over the course of the run. |
total_tokens |
int
|
Total number of tokens used (prompt + completion). |
completion_tokens
instance-attribute
completion_tokens: int
Number of completion tokens used over the course of the run.
prompt_tokens
instance-attribute
prompt_tokens: int
Number of prompt tokens used over the course of the run.
total_tokens
instance-attribute
total_tokens: int
Total number of tokens used (prompt + completion).