Class: OpenAI::Finetunes
- Inherits:
-
Object
- Object
- OpenAI::Finetunes
- Defined in:
- lib/openai/finetunes.rb
Instance Method Summary collapse
- #cancel(id:) ⇒ Object
- #create(parameters: {}) ⇒ Object
- #delete(fine_tuned_model:) ⇒ Object
- #events(id:) ⇒ Object
-
#initialize(access_token: nil, organization_id: nil) ⇒ Finetunes
constructor
A new instance of Finetunes.
- #list ⇒ Object
- #retrieve(id:) ⇒ Object
Constructor Details
#initialize(access_token: nil, organization_id: nil) ⇒ Finetunes
Returns a new instance of Finetunes.
3 4 5 6 |
# File 'lib/openai/finetunes.rb', line 3 def initialize(access_token: nil, organization_id: nil) OpenAI.configuration.access_token = access_token if access_token OpenAI.configuration.organization_id = organization_id if organization_id end |
Instance Method Details
#cancel(id:) ⇒ Object
20 21 22 |
# File 'lib/openai/finetunes.rb', line 20 def cancel(id:) OpenAI::Client.multipart_post(path: "/fine-tunes/#{id}/cancel") end |
#create(parameters: {}) ⇒ Object
12 13 14 |
# File 'lib/openai/finetunes.rb', line 12 def create(parameters: {}) OpenAI::Client.json_post(path: "/fine-tunes", parameters: parameters) end |
#delete(fine_tuned_model:) ⇒ Object
28 29 30 31 32 33 34 |
# File 'lib/openai/finetunes.rb', line 28 def delete(fine_tuned_model:) if fine_tuned_model.start_with?("ft-") raise ArgumentError, "Please give a fine_tuned_model name, not a fine-tune ID" end OpenAI::Client.delete(path: "/models/#{fine_tuned_model}") end |
#events(id:) ⇒ Object
24 25 26 |
# File 'lib/openai/finetunes.rb', line 24 def events(id:) OpenAI::Client.get(path: "/fine-tunes/#{id}/events") end |