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

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

#update(run_id, thread_id: , metadata: nil, request_options: {}) ⇒ 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::RunUpdateParams for more details.

Modifies a run.

Parameters:

  • run_id (String)

    Path param: The ID of the run to modify.

  • thread_id (String)

    Path param: The ID of the [thread](https://platform.openai.com/docs/api-referenc

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

    Body param: Set of 16 key-value pairs that can be attached to an object. This ca

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

Returns:

See Also:



207
208
209
210
211
212
213
214
215
216
217
218
219
220
# File 'lib/openai/resources/beta/threads/runs.rb', line 207

def update(run_id, params)
  parsed, options = OpenAI::Beta::Threads::RunUpdateParams.dump_request(params)
  thread_id =
    parsed.delete(:thread_id) do
      raise ArgumentError.new("missing required path argument #{_1}")
    end
  @client.request(
    method: :post,
    path: ["threads/%1$s/runs/%2$s", thread_id, run_id],
    body: parsed,
    model: OpenAI::Beta::Threads::Run,
    options: {extra_headers: {"OpenAI-Beta" => "assistants=v2"}, **options}
  )
end