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
#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
#cancel(fine_tune_id:) ⇒ Object
Cancels the details of a fine-tuning job with the specified id.
43 44 45 |
# File 'lib/asimov/api_v1/finetunes.rb', line 43 def cancel(fine_tune_id:) multipart_post(path: "#{URI_PREFIX}/#{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 |
# File 'lib/asimov/api_v1/finetunes.rb', line 23 def create(training_file:, parameters: {}) raise MissingRequiredParameterError.new(:training_file) unless training_file json_post(path: URI_PREFIX, 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 http_get(path: URI_PREFIX) end |
#list_events(fine_tune_id:) ⇒ Object
Lists the events associated with a fine-tuning job with the specified id.
52 53 54 |
# File 'lib/asimov/api_v1/finetunes.rb', line 52 def list_events(fine_tune_id:) http_get(path: "#{URI_PREFIX}/#{fine_tune_id}/events") end |
#retrieve(fine_tune_id:) ⇒ Object
Retrieves the details of a fine-tuning job with the specified id.
34 35 36 |
# File 'lib/asimov/api_v1/finetunes.rb', line 34 def retrieve(fine_tune_id:) http_get(path: "#{URI_PREFIX}/#{fine_tune_id}") end |