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

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

Overview

Deprecated.

The Assistants API is deprecated in favor of the Responses API

Build Assistants that can call models and use tools.

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:



131
132
133
# File 'lib/openai/resources/beta/threads/runs/steps.rb', line 131

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

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 defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list.

  • before (String) —

    Query param: A cursor for use in pagination. before is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with obj_foo, your subsequent call can include before=obj_foo in order to fetch the previous page of the list.

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

    Query param: A list of additional fields to include in the response. Currently the only supported value is step_details.tool_calls[*].file_search.results[*].content to fetch the file search result content.

    See the file search tool documentation for more information.

  • limit (Integer) —

    Query param: A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20.

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

    Query param: Sort order by the created_at timestamp of the objects. asc for ascending order and desc for descending order.

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

Returns:

See Also:



110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
# File 'lib/openai/resources/beta/threads/runs/steps.rb', line 110

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

  query = OpenAI::Internal::Util.encode_query_params(parsed)
  @client.request(
    method: :get,
    path: ["threads/%1$s/runs/%2$s/steps", thread_id, run_id],
    query: query,
    page: OpenAI::Internal::CursorPage,
    model: OpenAI::Beta::Threads::Runs::RunStep,
    security: {bearer_auth: true},
    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

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 the only supported value is step_details.tool_calls[*].file_search.results[*].content to fetch the file search result content.

    See the file search tool documentation for more information.

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

Returns:

See Also:



42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
# File 'lib/openai/resources/beta/threads/runs/steps.rb', line 42

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

  query = OpenAI::Internal::Util.encode_query_params(parsed)
  @client.request(
    method: :get,
    path: ["threads/%1$s/runs/%2$s/steps/%3$s", thread_id, run_id, step_id],
    query: query,
    model: OpenAI::Beta::Threads::Runs::RunStep,
    security: {bearer_auth: true},
    options: {extra_headers: {"OpenAI-Beta" => "assistants=v2"}, **options}
  )
end