Class: OpenAI::Resources::Beta::Threads::Runs::Steps Deprecated

Inherits:
Object
  • Object
show all
Defined in:
lib/openai/resources/beta/threads/runs/steps.rb

Overview

Deprecated.

The Assistants API is deprecated in favor of the Responses API

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ Steps

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of Steps.

Parameters:



98
99
100
# File 'lib/openai/resources/beta/threads/runs/steps.rb', line 98

def initialize(client:)
  @client = client
end

Instance Method Details

#list(run_id, thread_id: , after: nil, before: nil, include: nil, limit: nil, order: nil, request_options: {}) ⇒ OpenAI::Internal::CursorPage<OpenAI::Models::Beta::Threads::Runs::RunStep>

Deprecated.

The Assistants API is deprecated in favor of the Responses API

Some parameter documentations has been truncated, see Models::Beta::Threads::Runs::StepListParams for more details.

Returns a list of run steps belonging to a run.

Parameters:

  • run_id (String)

    Path param: The ID of the run the run steps belong to.

  • thread_id (String)

    Path param: The ID of the thread the run and run steps belong to.

  • after (String)

    Query param: A cursor for use in pagination. ‘after` is an object ID that define

  • before (String)

    Query param: A cursor for use in pagination. ‘before` is an object ID that defin

  • include (Array<Symbol, OpenAI::Models::Beta::Threads::Runs::RunStepInclude>)

    Query param: A list of additional fields to include in the response. Currently t

  • limit (Integer)

    Query param: A limit on the number of objects to be returned. Limit can range be

  • order (Symbol, OpenAI::Models::Beta::Threads::Runs::StepListParams::Order)

    Query param: Sort order by the ‘created_at` timestamp of the objects. `asc` for

  • request_options (OpenAI::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
# File 'lib/openai/resources/beta/threads/runs/steps.rb', line 79

def list(run_id, params)
  parsed, options = OpenAI::Beta::Threads::Runs::StepListParams.dump_request(params)
  thread_id =
    parsed.delete(:thread_id) do
      raise ArgumentError.new("missing required path argument #{_1}")
    end
  @client.request(
    method: :get,
    path: ["threads/%1$s/runs/%2$s/steps", thread_id, run_id],
    query: parsed,
    page: OpenAI::Internal::CursorPage,
    model: OpenAI::Beta::Threads::Runs::RunStep,
    options: {extra_headers: {"OpenAI-Beta" => "assistants=v2"}, **options}
  )
end

#retrieve(step_id, thread_id: , run_id: , include: nil, request_options: {}) ⇒ OpenAI::Models::Beta::Threads::Runs::RunStep

Deprecated.

The Assistants API is deprecated in favor of the Responses API

Some parameter documentations has been truncated, see Models::Beta::Threads::Runs::StepRetrieveParams for more details.

Retrieves a run step.

Parameters:

  • step_id (String)

    Path param: The ID of the run step to retrieve.

  • thread_id (String)

    Path param: The ID of the thread to which the run and run step belongs.

  • run_id (String)

    Path param: The ID of the run to which the run step belongs.

  • include (Array<Symbol, OpenAI::Models::Beta::Threads::Runs::RunStepInclude>)

    Query param: A list of additional fields to include in the response. Currently t

  • request_options (OpenAI::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
# File 'lib/openai/resources/beta/threads/runs/steps.rb', line 32

def retrieve(step_id, params)
  parsed, options = OpenAI::Beta::Threads::Runs::StepRetrieveParams.dump_request(params)
  thread_id =
    parsed.delete(:thread_id) do
      raise ArgumentError.new("missing required path argument #{_1}")
    end
  run_id =
    parsed.delete(:run_id) do
      raise ArgumentError.new("missing required path argument #{_1}")
    end
  @client.request(
    method: :get,
    path: ["threads/%1$s/runs/%2$s/steps/%3$s", thread_id, run_id, step_id],
    query: parsed,
    model: OpenAI::Beta::Threads::Runs::RunStep,
    options: {extra_headers: {"OpenAI-Beta" => "assistants=v2"}, **options}
  )
end