Class: OpenAI::Model::Run
- Inherits:
-
Object
- Object
- OpenAI::Model::Run
- Defined in:
- lib/openai/models/run.rb
Overview
Represents an execution run on a thread.
Instance Attribute Summary collapse
-
#assistant_id ⇒ String
readonly
The ID of the assistant used for execution of this run.
-
#cancelled_at ⇒ Integer | nil
readonly
The Unix timestamp (in seconds) for when the run was cancelled.
-
#completed_at ⇒ Integer | nil
readonly
The Unix timestamp (in seconds) for when the run was completed.
-
#created_at ⇒ Integer
readonly
The Unix timestamp (in seconds) for when the run was created.
-
#expires_at ⇒ Integer | nil
readonly
The Unix timestamp (in seconds) for when the run will expire.
-
#failed_at ⇒ Integer | nil
readonly
The Unix timestamp (in seconds) for when the run failed.
-
#id ⇒ String
readonly
The identifier, which can be referenced in API endpoints.
-
#incomplete_details ⇒ String | nil
readonly
Details on why the run is incomplete.
-
#instructions ⇒ String
readonly
The instructions that the assistant used for this run.
-
#last_error ⇒ String | nil
readonly
The last error associated with this run.
-
#max_completion_tokens ⇒ Integer | nil
readonly
The maximum number of completion tokens specified to have been used over the course of the run.
-
#max_prompt_tokens ⇒ Integer | nil
readonly
The maximum number of prompt tokens specified to have been used over the course of the run.
-
#metadata ⇒ Hash[String, String]
readonly
Set of 16 key-value pairs that can be attached to an object.
-
#model ⇒ String
readonly
The model that the assistant used for this run.
-
#object ⇒ String
readonly
The object type, which is always thread.run.
-
#required_action ⇒ String | nil
readonly
Details on the action required to continue the run.
-
#response_format ⇒ String
readonly
Specifies the format that the model must output.
-
#started_at ⇒ Integer | nil
readonly
The Unix timestamp (in seconds) for when the run was started.
-
#status ⇒ String
readonly
The status of the run, which can be either queued, in_progress, requires_action, cancelling, cancelled, failed, completed, or expired.
-
#temperature ⇒ Number | nil
readonly
The sampling temperature used for this run.
-
#thread_id ⇒ String
readonly
The ID of the thread that was executed on as a part of this run.
-
#tool_choice ⇒ String
readonly
Controls which (if any) tool is called by the model.
-
#tools ⇒ String
readonly
The list of tools that the assistant used for this run.
-
#top_p ⇒ Number | nil
readonly
The nucleus sampling value used for this run.
-
#truncation_strategy ⇒ String
readonly
Controls for how a thread will be truncated prior to the run.
-
#usage ⇒ String | nil
readonly
Usage statistics related to the run.
Instance Method Summary collapse
-
#initialize(attributes) ⇒ Run
constructor
A new instance of Run.
Constructor Details
#initialize(attributes) ⇒ Run
Returns a new instance of Run.
84 85 86 87 88 |
# File 'lib/openai/models/run.rb', line 84 def initialize(attributes) attributes.each do |key, value| instance_variable_set("@#{key}", value) end end |
Instance Attribute Details
#assistant_id ⇒ String (readonly)
Returns The ID of the assistant used for execution of this run.
19 20 21 |
# File 'lib/openai/models/run.rb', line 19 def assistant_id @assistant_id end |
#cancelled_at ⇒ Integer | nil (readonly)
Returns The Unix timestamp (in seconds) for when the run was cancelled.
37 38 39 |
# File 'lib/openai/models/run.rb', line 37 def cancelled_at @cancelled_at end |
#completed_at ⇒ Integer | nil (readonly)
Returns The Unix timestamp (in seconds) for when the run was completed.
43 44 45 |
# File 'lib/openai/models/run.rb', line 43 def completed_at @completed_at end |
#created_at ⇒ Integer (readonly)
Returns The Unix timestamp (in seconds) for when the run was created.
13 14 15 |
# File 'lib/openai/models/run.rb', line 13 def created_at @created_at end |
#expires_at ⇒ Integer | nil (readonly)
Returns The Unix timestamp (in seconds) for when the run will expire.
31 32 33 |
# File 'lib/openai/models/run.rb', line 31 def expires_at @expires_at end |
#failed_at ⇒ Integer | nil (readonly)
Returns The Unix timestamp (in seconds) for when the run failed.
40 41 42 |
# File 'lib/openai/models/run.rb', line 40 def failed_at @failed_at end |
#id ⇒ String (readonly)
Returns The identifier, which can be referenced in API endpoints.
7 8 9 |
# File 'lib/openai/models/run.rb', line 7 def id @id end |
#incomplete_details ⇒ String | nil (readonly)
Returns Details on why the run is incomplete. Will be null if the run is not incomplete.
46 47 48 |
# File 'lib/openai/models/run.rb', line 46 def incomplete_details @incomplete_details end |
#instructions ⇒ String (readonly)
Returns The instructions that the assistant used for this run.
52 53 54 |
# File 'lib/openai/models/run.rb', line 52 def instructions @instructions end |
#last_error ⇒ String | nil (readonly)
Returns The last error associated with this run. Will be null if there are no errors.
28 29 30 |
# File 'lib/openai/models/run.rb', line 28 def last_error @last_error end |
#max_completion_tokens ⇒ Integer | nil (readonly)
Returns The maximum number of completion tokens specified to have been used over the course of the run.
73 74 75 |
# File 'lib/openai/models/run.rb', line 73 def max_completion_tokens @max_completion_tokens end |
#max_prompt_tokens ⇒ Integer | nil (readonly)
Returns The maximum number of prompt tokens specified to have been used over the course of the run.
70 71 72 |
# File 'lib/openai/models/run.rb', line 70 def max_prompt_tokens @max_prompt_tokens end |
#metadata ⇒ Hash[String, String] (readonly)
Returns 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.
58 59 60 |
# File 'lib/openai/models/run.rb', line 58 def @metadata end |
#model ⇒ String (readonly)
Returns The model that the assistant used for this run.
49 50 51 |
# File 'lib/openai/models/run.rb', line 49 def model @model end |
#object ⇒ String (readonly)
Returns The object type, which is always thread.run.
10 11 12 |
# File 'lib/openai/models/run.rb', line 10 def object @object end |
#required_action ⇒ String | nil (readonly)
Returns Details on the action required to continue the run. Will be null if no action is required.
25 26 27 |
# File 'lib/openai/models/run.rb', line 25 def required_action @required_action end |
#response_format ⇒ String (readonly)
Returns Specifies the format that the model must output.
82 83 84 |
# File 'lib/openai/models/run.rb', line 82 def response_format @response_format end |
#started_at ⇒ Integer | nil (readonly)
Returns The Unix timestamp (in seconds) for when the run was started.
34 35 36 |
# File 'lib/openai/models/run.rb', line 34 def started_at @started_at end |
#status ⇒ String (readonly)
Returns The status of the run, which can be either queued, in_progress, requires_action, cancelling, cancelled, failed, completed, or expired.
22 23 24 |
# File 'lib/openai/models/run.rb', line 22 def status @status end |
#temperature ⇒ Number | nil (readonly)
Returns The sampling temperature used for this run. If not set, defaults to 1.
64 65 66 |
# File 'lib/openai/models/run.rb', line 64 def temperature @temperature end |
#thread_id ⇒ String (readonly)
Returns The ID of the thread that was executed on as a part of this run.
16 17 18 |
# File 'lib/openai/models/run.rb', line 16 def thread_id @thread_id end |
#tool_choice ⇒ String (readonly)
Returns 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 “file_search” or “function”, “function”: {“name”: “my_function”} forces the model to call that tool.
79 80 81 |
# File 'lib/openai/models/run.rb', line 79 def tool_choice @tool_choice end |
#tools ⇒ String (readonly)
Returns The list of tools that the assistant used for this run.
55 56 57 |
# File 'lib/openai/models/run.rb', line 55 def tools @tools end |
#top_p ⇒ Number | nil (readonly)
Returns The nucleus sampling value used for this run. If not set, defaults to 1.
67 68 69 |
# File 'lib/openai/models/run.rb', line 67 def top_p @top_p end |
#truncation_strategy ⇒ String (readonly)
Returns Controls for how a thread will be truncated prior to the run. Use this to control the initial context window of the run.
76 77 78 |
# File 'lib/openai/models/run.rb', line 76 def truncation_strategy @truncation_strategy end |
#usage ⇒ String | nil (readonly)
Returns 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.).
61 62 63 |
# File 'lib/openai/models/run.rb', line 61 def usage @usage end |