Method: OpenAI::Resources::Beta::Threads::Runs#list

Defined in:
lib/openai/resources/beta/threads/runs.rb

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

Deprecated.

The Assistants API is deprecated in favor of the Responses API

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

Returns a list of runs belonging to a thread.

Parameters:

  • thread_id (String)

    The ID of the thread the run belongs to.

  • after (String)

    A cursor for use in pagination. after is an object ID that defines your place

  • before (String)

    A cursor for use in pagination. before is an object ID that defines your place

  • limit (Integer)

    A limit on the number of objects to be returned. Limit can range between 1 and 1

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

    Sort order by the created_at timestamp of the objects. asc for ascending ord

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

Returns:

See Also:



246
247
248
249
250
251
252
253
254
255
256
# File 'lib/openai/resources/beta/threads/runs.rb', line 246

def list(thread_id, params = {})
  parsed, options = OpenAI::Beta::Threads::RunListParams.dump_request(params)
  @client.request(
    method: :get,
    path: ["threads/%1$s/runs", thread_id],
    query: parsed,
    page: OpenAI::Internal::CursorPage,
    model: OpenAI::Beta::Threads::Run,
    options: {extra_headers: {"OpenAI-Beta" => "assistants=v2"}, **options}
  )
end