Method: OpenAI::Resources::Chat::Completions#update

Defined in:
lib/openai/resources/chat/completions.rb

#update(completion_id, metadata: , request_options: {}) ⇒ OpenAI::Models::Chat::ChatCompletion

Some parameter documentations has been truncated, see Models::Chat::CompletionUpdateParams for more details.

Modify a stored chat completion. Only Chat Completions that have been created with the store parameter set to true can be modified. Currently, the only supported modification is to update the metadata field.

Parameters:

  • completion_id (String)

    The ID of the chat completion to update.

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

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

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

Returns:

See Also:



361
362
363
364
365
366
367
368
369
370
# File 'lib/openai/resources/chat/completions.rb', line 361

def update(completion_id, params)
  parsed, options = OpenAI::Chat::CompletionUpdateParams.dump_request(params)
  @client.request(
    method: :post,
    path: ["chat/completions/%1$s", completion_id],
    body: parsed,
    model: OpenAI::Chat::ChatCompletion,
    options: options
  )
end