Class: Asimov::ApiV1::Finetunes
- Inherits:
-
Base
- Object
- Base
- Asimov::ApiV1::Finetunes
show all
- Defined in:
- lib/asimov/api_v1/finetunes.rb
Overview
Class interface for API methods in the “/fine-tunes” URI subspace.
Constant Summary
collapse
- URI_PREFIX =
"/fine-tunes".freeze
Instance Method Summary
collapse
Methods inherited from Base
#check_for_api_error, #http_delete, #http_get, #http_streamed_download, #initialize, #json_post, #multipart_post, #wrap_response_with_error_handling
Instance Method Details
#cancel(fine_tune_id:) ⇒ Object
23
24
25
|
# File 'lib/asimov/api_v1/finetunes.rb', line 23
def cancel(fine_tune_id:)
multipart_post(path: "#{URI_PREFIX}/#{fine_tune_id}/cancel")
end
|
#create(parameters:) ⇒ Object
13
14
15
16
17
|
# File 'lib/asimov/api_v1/finetunes.rb', line 13
def create(parameters:)
raise MissingRequiredParameterError.new(:training_file) unless parameters[:training_file]
json_post(path: URI_PREFIX, parameters: parameters)
end
|
#events(fine_tune_id:) ⇒ Object
27
28
29
|
# File 'lib/asimov/api_v1/finetunes.rb', line 27
def events(fine_tune_id:)
http_get(path: "#{URI_PREFIX}/#{fine_tune_id}/events")
end
|
#list ⇒ Object
9
10
11
|
# File 'lib/asimov/api_v1/finetunes.rb', line 9
def list
http_get(path: URI_PREFIX)
end
|
#retrieve(fine_tune_id:) ⇒ Object
19
20
21
|
# File 'lib/asimov/api_v1/finetunes.rb', line 19
def retrieve(fine_tune_id:)
http_get(path: "#{URI_PREFIX}/#{fine_tune_id}")
end
|