Class: OpenAI::Models::Beta::Threads::Runs::RunStep

Inherits:
Internal::Type::BaseModel show all
Defined in:
lib/openai/models/beta/threads/runs/run_step.rb,
sig/openai/models/beta/threads/runs/run_step.rbs

Overview

See Also:

  • OpenAI::Resources::Beta::Threads::Runs::Steps#retrieve

Defined Under Namespace

Modules: Status, StepDetails, Type Classes: LastError, Usage

Instance Attribute Summary collapse

Attributes inherited from Internal::Type::BaseModel

#last_response

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Internal::Type::BaseModel

==, #==, #[], #_request_id, #_set_last_response, coerce, #deconstruct_keys, #deep_to_h, dump, #encode_with, 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, coerce_with_error, dump, #dump, #inspect, inspect, meta_info, new_coerce_state, 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(id:, assistant_id:, cancelled_at:, completed_at:, created_at:, expired_at:, failed_at:, last_error:, metadata:, run_id:, status:, step_details:, thread_id:, type:, usage:, object: :"thread.run.step") ⇒ Object

Parameters:

  • id —

    The identifier of the run step, which can be referenced in API endpoints.

  • assistant_id —

    The ID of the assistant associated with the run step.

  • cancelled_at —

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

  • completed_at —

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

  • created_at —

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

  • expired_at —

    The Unix timestamp (in seconds) for when the run step expired. A step is considered expired if the parent run is expired.

  • failed_at —

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

  • last_error —

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

  • metadata —

    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.

  • run_id —

    The ID of the run that this run step is a part of.

  • status —

    The status of the run step, which can be either in_progress, cancelled, failed, completed, or expired.

  • step_details —

    The details of the run step.

  • thread_id —

    The ID of the thread that was run.

  • type —

    The type of run step, which can be either message_creation or tool_calls.

  • usage —

    Usage statistics related to the run step. This value will be null while the run step's status is in_progress.

  • object (defaults to: :"thread.run.step") —

    The object type, which is always thread.run.step.



# File 'lib/openai/models/beta/threads/runs/run_step.rb', line 120

Instance Attribute Details

#assistant_id ⇒ String

The ID of the assistant associated with the run step.

Returns:

  • (String)


22
# File 'lib/openai/models/beta/threads/runs/run_step.rb', line 22

required :assistant_id, String

#cancelled_at ⇒ Integer?

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

Returns:

  • (Integer, nil)


28
# File 'lib/openai/models/beta/threads/runs/run_step.rb', line 28

required :cancelled_at, Integer, nil?: true

#completed_at ⇒ Integer?

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

Returns:

  • (Integer, nil)


34
# File 'lib/openai/models/beta/threads/runs/run_step.rb', line 34

required :completed_at, Integer, nil?: true

#created_at ⇒ Integer

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

Returns:

  • (Integer)


40
# File 'lib/openai/models/beta/threads/runs/run_step.rb', line 40

required :created_at, Integer

#expired_at ⇒ Integer?

The Unix timestamp (in seconds) for when the run step expired. A step is considered expired if the parent run is expired.

Returns:

  • (Integer, nil)


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

required :expired_at, Integer, nil?: true

#failed_at ⇒ Integer?

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

Returns:

  • (Integer, nil)


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

required :failed_at, Integer, nil?: true

#id ⇒ String

The identifier of the run step, which can be referenced in API endpoints.

Returns:

  • (String)


14
# File 'lib/openai/models/beta/threads/runs/run_step.rb', line 14

required :id, String

#last_error ⇒ OpenAI::Beta::Threads::Runs::RunStep::LastError?

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

Returns:

  • (OpenAI::Beta::Threads::Runs::RunStep::LastError, nil)


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

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

#metadata ⇒ OpenAI::Models::metadata?

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:

  • (OpenAI::Models::metadata, nil)


71
# File 'lib/openai/models/beta/threads/runs/run_step.rb', line 71

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

#object ⇒ :"thread.run.step"

The object type, which is always thread.run.step.

Returns:

  • (:"thread.run.step")


77
# File 'lib/openai/models/beta/threads/runs/run_step.rb', line 77

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

#run_id ⇒ String

The ID of the run that this run step is a part of.

Returns:

  • (String)


84
# File 'lib/openai/models/beta/threads/runs/run_step.rb', line 84

required :run_id, String

#status ⇒ OpenAI::Models::Beta::Threads::Runs::RunStep::status

The status of the run step, which can be either in_progress, cancelled, failed, completed, or expired.

Returns:

  • (OpenAI::Models::Beta::Threads::Runs::RunStep::status)


91
# File 'lib/openai/models/beta/threads/runs/run_step.rb', line 91

required :status, enum: -> { OpenAI::Beta::Threads::Runs::RunStep::Status }

#step_details ⇒ OpenAI::Models::Beta::Threads::Runs::RunStep::step_details

The details of the run step.

Returns:

  • (OpenAI::Models::Beta::Threads::Runs::RunStep::step_details)


97
# File 'lib/openai/models/beta/threads/runs/run_step.rb', line 97

required :step_details, union: -> { OpenAI::Beta::Threads::Runs::RunStep::StepDetails }

#thread_id ⇒ String

The ID of the thread that was run.

Returns:

  • (String)


105
# File 'lib/openai/models/beta/threads/runs/run_step.rb', line 105

required :thread_id, String

#type ⇒ OpenAI::Models::Beta::Threads::Runs::RunStep::type_

The type of run step, which can be either message_creation or tool_calls.

Returns:

  • (OpenAI::Models::Beta::Threads::Runs::RunStep::type_)


111
# File 'lib/openai/models/beta/threads/runs/run_step.rb', line 111

required :type, enum: -> { OpenAI::Beta::Threads::Runs::RunStep::Type }

#usage ⇒ OpenAI::Beta::Threads::Runs::RunStep::Usage?

Usage statistics related to the run step. This value will be null while the run step's status is in_progress.

Returns:

  • (OpenAI::Beta::Threads::Runs::RunStep::Usage, nil)


118
# File 'lib/openai/models/beta/threads/runs/run_step.rb', line 118

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

Class Method Details

.values ⇒ Array<Symbol>

Returns:

  • (Array<Symbol>)


# File 'lib/openai/models/beta/threads/runs/run_step.rb', line 218

.variants ⇒ Array(OpenAI::Models::Beta::Threads::Runs::MessageCreationStepDetails, OpenAI::Models::Beta::Threads::Runs::ToolCallsStepDetails)



# File 'lib/openai/models/beta/threads/runs/run_step.rb', line 254

Instance Method Details

#to_hash ⇒ {

Returns:

  • ({)


156
# File 'sig/openai/models/beta/threads/runs/run_step.rbs', line 156

def to_hash: -> {