Class: Asimov::ApiV1::Finetunes
- Defined in:
- lib/asimov/api_v1/finetunes.rb
Overview
Class interface for API methods in the “/fine-tunes” URI subspace.
Instance Method Summary collapse
-
#cancel(fine_tune_id:) ⇒ Object
Cancels the details of a fine-tuning job with the specified id.
-
#create(training_file:, parameters: {}) ⇒ Object
Creates a new fine-tuning job with the specified parameters.
-
#list ⇒ Object
Lists the set of fine-tuning jobs for this API key and (optionally) organization.
-
#list_events(fine_tune_id:) ⇒ Object
Lists the events associated with a fine-tuning job with the specified id.
-
#retrieve(fine_tune_id:) ⇒ Object
Retrieves the details of a fine-tuning job with the specified id.
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
#cancel(fine_tune_id:) ⇒ Object
Cancels the details of a fine-tuning job with the specified id.
44 45 46 |
# File 'lib/asimov/api_v1/finetunes.rb', line 44 def cancel(fine_tune_id:) rest_create_w_multipart_params(resource: [RESOURCE, fine_tune_id, "cancel"]) end |
#create(training_file:, parameters: {}) ⇒ Object
Creates a new fine-tuning job with the specified parameters.
23 24 25 26 27 28 |
# File 'lib/asimov/api_v1/finetunes.rb', line 23 def create(training_file:, parameters: {}) raise MissingRequiredParameterError.new(:training_file) unless training_file rest_create_w_json_params(resource: RESOURCE, parameters: parameters.merge(training_file: training_file)) end |
#list ⇒ Object
Lists the set of fine-tuning jobs for this API key and (optionally) organization.
13 14 15 |
# File 'lib/asimov/api_v1/finetunes.rb', line 13 def list rest_index(resource: RESOURCE) end |
#list_events(fine_tune_id:) ⇒ Object
Lists the events associated with a fine-tuning job with the specified id.
53 54 55 |
# File 'lib/asimov/api_v1/finetunes.rb', line 53 def list_events(fine_tune_id:) rest_index(resource: [RESOURCE, fine_tune_id, "events"]) end |
#retrieve(fine_tune_id:) ⇒ Object
Retrieves the details of a fine-tuning job with the specified id.
35 36 37 |
# File 'lib/asimov/api_v1/finetunes.rb', line 35 def retrieve(fine_tune_id:) rest_get(resource: RESOURCE, id: fine_tune_id) end |