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

#initialize, #rest_create_w_json_params, #rest_create_w_multipart_params, #rest_delete, #rest_get, #rest_get_streamed_download, #rest_index

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:)
  rest_delete(resource: RESOURCE, id: 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
  rest_index(resource: RESOURCE)
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:)
  rest_get(resource: RESOURCE, id: model_id)
end