Class: Openai::Models

Inherits:
Resource::Api show all
Defined in:
lib/openai/models.rb

Instance Attribute Summary

Attributes inherited from Resource::Api

#connection, #data, #path, #response

Instance Method Summary collapse

Constructor Details

#initializeModels

Returns a new instance of Models.



5
6
7
8
# File 'lib/openai/models.rb', line 5

def initialize
  @path = "/v1/models"
  super()
end

Instance Method Details

#requestObject



10
11
12
13
# File 'lib/openai/models.rb', line 10

def request
  @response = @connection.get(path: @path)
  @data = ::Openai::Mapper::Models.from_json(super())
end