Class: Asimov::ApiV1::Models

Inherits:
Base
  • Object
show all
Defined in:
lib/asimov/api_v1/models.rb

Overview

Class interface for API methods in the “/models” URI subspace.

Instance Method Summary collapse

Methods inherited from Base

#http_delete, #http_get, #http_streamed_download, #initialize, #json_post, #multipart_post

Constructor Details

This class inherits a constructor from Asimov::ApiV1::Base

Instance Method Details

#delete(model_id:) ⇒ Object

Deletes the model with the specified model_id. Only works on models created via fine tuning.

Parameters:

  • model_id (String)

    the id of the model to be deleted


34
35
36
# File 'lib/asimov/api_v1/models.rb', line 34

def delete(model_id:)
  http_delete(path: "#{URI_PREFIX}/#{model_id}")
end

#listObject

Lists the models accessible to this combination of OpenAI API key and organization id.


14
15
16
# File 'lib/asimov/api_v1/models.rb', line 14

def list
  http_get(path: URI_PREFIX)
end

#retrieve(model_id:) ⇒ Object

Retrieve information about the model with the specified model_id.

Parameters:

  • model_id (String)

    the id of the model to be retrieved


24
25
26
# File 'lib/asimov/api_v1/models.rb', line 24

def retrieve(model_id:)
  http_get(path: "#{URI_PREFIX}/#{model_id}")
end