Class: OpenAI::Resources::Models
- Inherits:
-
Object
- Object
- OpenAI::Resources::Models
- Defined in:
- lib/openai/resources/models.rb
Instance Method Summary collapse
-
#delete(model, request_options: {}) ⇒ OpenAI::Models::ModelDeleted
Delete a fine-tuned model.
-
#initialize(client:) ⇒ Models
constructor
private
A new instance of Models.
-
#list(request_options: {}) ⇒ OpenAI::Internal::Page<OpenAI::Models::Model>
Lists the currently available models, and provides basic information about each one such as the owner and availability.
-
#retrieve(model, request_options: {}) ⇒ OpenAI::Models::Model
Retrieves a model instance, providing basic information about the model such as the owner and permissioning.
Constructor Details
#initialize(client:) ⇒ Models
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of Models.
71 72 73 |
# File 'lib/openai/resources/models.rb', line 71 def initialize(client:) @client = client end |
Instance Method Details
#delete(model, request_options: {}) ⇒ OpenAI::Models::ModelDeleted
Delete a fine-tuned model. You must have the Owner role in your organization to delete a model.
59 60 61 62 63 64 65 66 |
# File 'lib/openai/resources/models.rb', line 59 def delete(model, params = {}) @client.request( method: :delete, path: ["models/%1$s", model], model: OpenAI::ModelDeleted, options: params[:request_options] ) end |
#list(request_options: {}) ⇒ OpenAI::Internal::Page<OpenAI::Models::Model>
Lists the currently available models, and provides basic information about each one such as the owner and availability.
37 38 39 40 41 42 43 44 45 |
# File 'lib/openai/resources/models.rb', line 37 def list(params = {}) @client.request( method: :get, path: "models", page: OpenAI::Internal::Page, model: OpenAI::Model, options: params[:request_options] ) end |
#retrieve(model, request_options: {}) ⇒ OpenAI::Models::Model
Retrieves a model instance, providing basic information about the model such as the owner and permissioning.
18 19 20 21 22 23 24 25 |
# File 'lib/openai/resources/models.rb', line 18 def retrieve(model, params = {}) @client.request( method: :get, path: ["models/%1$s", model], model: OpenAI::Model, options: params[:request_options] ) end |