Method: OpenAI::Resources::Chat::Completions#retrieve

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

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

Get a stored chat completion. Only Chat Completions that have been created with the store parameter set to true will be returned.

Parameters:

  • completion_id (String)

    The ID of the chat completion to retrieve.

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

Returns:

See Also:



334
335
336
337
338
339
340
341
# File 'lib/openai/resources/chat/completions.rb', line 334

def retrieve(completion_id, params = {})
  @client.request(
    method: :get,
    path: ["chat/completions/%1$s", completion_id],
    model: OpenAI::Chat::ChatCompletion,
    options: params[:request_options]
  )
end