Class: OpenAI::Models::Beta::Threads::Run

Inherits:
Internal::Type::BaseModel show all
Defined in:
lib/openai/models/beta/threads/run.rb

Overview

Defined Under Namespace

Classes: IncompleteDetails, LastError, RequiredAction, TruncationStrategy, Usage

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Internal::Type::BaseModel

==, #==, #[], coerce, #deconstruct_keys, #deep_to_h, dump, fields, hash, #hash, inherited, inspect, #inspect, known_fields, optional, recursively_to_h, required, #to_h, #to_json, #to_s, to_sorbet_type, #to_yaml

Methods included from Internal::Type::Converter

#coerce, coerce, #dump, dump, #inspect, inspect, type_info

Methods included from Internal::Util::SorbetRuntimeSupport

#const_missing, #define_sorbet_constant!, #sorbet_constant_defined?, #to_sorbet_type, to_sorbet_type

Constructor Details

#initialize(tool_calls: ) ⇒ Object

Details on the tool outputs needed for this run to continue.

Parameters:



# File 'lib/openai/models/beta/threads/run.rb', line 222

Instance Attribute Details

#assistant_idString

The ID of the [assistant](platform.openai.com/docs/api-reference/assistants) used for execution of this run.

Returns:

  • (String)


23
# File 'lib/openai/models/beta/threads/run.rb', line 23

required :assistant_id, String

#cancelled_atInteger?

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

Returns:

  • (Integer, nil)


29
# File 'lib/openai/models/beta/threads/run.rb', line 29

required :cancelled_at, Integer, nil?: true

#completed_atInteger?

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

Returns:

  • (Integer, nil)


35
# File 'lib/openai/models/beta/threads/run.rb', line 35

required :completed_at, Integer, nil?: true

#created_atInteger

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

Returns:

  • (Integer)


41
# File 'lib/openai/models/beta/threads/run.rb', line 41

required :created_at, Integer

#expires_atInteger?

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

Returns:

  • (Integer, nil)


47
# File 'lib/openai/models/beta/threads/run.rb', line 47

required :expires_at, Integer, nil?: true

#failed_atInteger?

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

Returns:

  • (Integer, nil)


53
# File 'lib/openai/models/beta/threads/run.rb', line 53

required :failed_at, Integer, nil?: true

#idString

The identifier, which can be referenced in API endpoints.

Returns:

  • (String)


15
# File 'lib/openai/models/beta/threads/run.rb', line 15

required :id, String

#incomplete_detailsOpenAI::Models::Beta::Threads::Run::IncompleteDetails?

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



60
# File 'lib/openai/models/beta/threads/run.rb', line 60

required :incomplete_details, -> { OpenAI::Beta::Threads::Run::IncompleteDetails }, nil?: true

#instructionsString

The instructions that the [assistant](platform.openai.com/docs/api-reference/assistants) used for this run.

Returns:

  • (String)


68
# File 'lib/openai/models/beta/threads/run.rb', line 68

required :instructions, String

#last_errorOpenAI::Models::Beta::Threads::Run::LastError?

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



74
# File 'lib/openai/models/beta/threads/run.rb', line 74

required :last_error, -> { OpenAI::Beta::Threads::Run::LastError }, nil?: true

#max_completion_tokensInteger?

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

Returns:

  • (Integer, nil)


81
# File 'lib/openai/models/beta/threads/run.rb', line 81

required :max_completion_tokens, Integer, nil?: true

#max_prompt_tokensInteger?

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

Returns:

  • (Integer, nil)


88
# File 'lib/openai/models/beta/threads/run.rb', line 88

required :max_prompt_tokens, Integer, nil?: true

#metadataHash{Symbol=>String}?

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.

Returns:

  • (Hash{Symbol=>String}, nil)


99
# File 'lib/openai/models/beta/threads/run.rb', line 99

required :metadata, OpenAI::Internal::Type::HashOf[String], nil?: true

#modelString

The model that the [assistant](platform.openai.com/docs/api-reference/assistants) used for this run.

Returns:

  • (String)


107
# File 'lib/openai/models/beta/threads/run.rb', line 107

required :model, String

#objectSymbol, :"thread.run"

The object type, which is always ‘thread.run`.

Returns:

  • (Symbol, :"thread.run")


113
# File 'lib/openai/models/beta/threads/run.rb', line 113

required :object, const: :"thread.run"

#parallel_tool_callsBoolean

Whether to enable [parallel function calling](platform.openai.com/docs/guides/function-calling#configuring-parallel-function-calling) during tool use.

Returns:



121
# File 'lib/openai/models/beta/threads/run.rb', line 121

required :parallel_tool_calls, OpenAI::Internal::Type::Boolean

#required_actionOpenAI::Models::Beta::Threads::Run::RequiredAction?

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



128
# File 'lib/openai/models/beta/threads/run.rb', line 128

required :required_action, -> { OpenAI::Beta::Threads::Run::RequiredAction }, nil?: true

#response_formatSymbol, ...

Specifies the format that the model must output. Compatible with [GPT-4o](platform.openai.com/docs/models#gpt-4o), [GPT-4 Turbo](platform.openai.com/docs/models#gpt-4-turbo-and-gpt-4), 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](platform.openai.com/docs/guides/structured-outputs).

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 exceeded `max_tokens` or the conversation exceeded the max context length.



153
# File 'lib/openai/models/beta/threads/run.rb', line 153

required :response_format, union: -> { OpenAI::Beta::AssistantResponseFormatOption }, nil?: true

#started_atInteger?

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

Returns:

  • (Integer, nil)


159
# File 'lib/openai/models/beta/threads/run.rb', line 159

required :started_at, Integer, nil?: true

#statusSymbol, OpenAI::Models::Beta::Threads::RunStatus

The status of the run, which can be either ‘queued`, `in_progress`, `requires_action`, `cancelling`, `cancelled`, `failed`, `completed`, `incomplete`, or `expired`.



167
# File 'lib/openai/models/beta/threads/run.rb', line 167

required :status, enum: -> { OpenAI::Beta::Threads::RunStatus }

#temperatureFloat?

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

Returns:

  • (Float, nil)


214
# File 'lib/openai/models/beta/threads/run.rb', line 214

optional :temperature, Float, nil?: true

#thread_idString

The ID of the [thread](platform.openai.com/docs/api-reference/threads) that was executed on as a part of this run.

Returns:

  • (String)


174
# File 'lib/openai/models/beta/threads/run.rb', line 174

required :thread_id, String

#tool_choiceSymbol, ...

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.



186
# File 'lib/openai/models/beta/threads/run.rb', line 186

required :tool_choice, union: -> { OpenAI::Beta::AssistantToolChoiceOption }, nil?: true

#toolsArray<OpenAI::Models::Beta::CodeInterpreterTool, OpenAI::Models::Beta::FileSearchTool, OpenAI::Models::Beta::FunctionTool>

The list of tools that the [assistant](platform.openai.com/docs/api-reference/assistants) used for this run.



194
# File 'lib/openai/models/beta/threads/run.rb', line 194

required :tools, -> { OpenAI::Internal::Type::ArrayOf[union: OpenAI::Beta::AssistantTool] }

#top_pFloat?

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

Returns:

  • (Float, nil)


220
# File 'lib/openai/models/beta/threads/run.rb', line 220

optional :top_p, Float, nil?: true

#truncation_strategyOpenAI::Models::Beta::Threads::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.



201
# File 'lib/openai/models/beta/threads/run.rb', line 201

required :truncation_strategy, -> { OpenAI::Beta::Threads::Run::TruncationStrategy }, nil?: true

#usageOpenAI::Models::Beta::Threads::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.).



208
# File 'lib/openai/models/beta/threads/run.rb', line 208

required :usage, -> { OpenAI::Beta::Threads::Run::Usage }, nil?: true

Class Method Details

.valuesArray<Symbol>

Returns:

  • (Array<Symbol>)


# File 'lib/openai/models/beta/threads/run.rb', line 311