Class: Openai::Client::Models
- Inherits:
-
Object
- Object
- Openai::Client::Models
- Defined in:
- lib/openai/client/models.rb
Constant Summary collapse
- PATH =
'models'
Instance Method Summary collapse
-
#find(id) ⇒ Hash
Public: Makes an API call to find the model by the ID.
-
#list ⇒ Hash
Public: Makes an API call to return all models.
Instance Method Details
#find(id) ⇒ Hash
Public: Makes an API call to find the model by the ID.
24 25 26 27 28 |
# File 'lib/openai/client/models.rb', line 24 def find(id) Http.new.get("#{PATH}/#{id}").body rescue Faraday::Error nil end |
#list ⇒ Hash
Public: Makes an API call to return all models.
12 13 14 15 16 |
# File 'lib/openai/client/models.rb', line 12 def list Http.new.get(PATH).body rescue Faraday::Error nil end |