Module: Openai::Client::Configurable

Included in:
Openai::Client
Defined in:
lib/openai/client/configurable.rb

Instance Method Summary collapse

Instance Method Details

#configurationOpenai::Client::Configuration

Public: Returns the instance of Configuration class

Returns:



10
11
12
# File 'lib/openai/client/configurable.rb', line 10

def configuration
  @configuration ||= Configuration.new
end

#configure {|configuration| ... } ⇒ Openai::Client::Configuration

Public: Allows to provide configuration values

Example:

Openai::Client.configure do |c|
  c.logger          = Rails.logger
  c.access_token    = 'access_token_goes_here'
  c.organization_id = 'organization_id_goes_here'
  c.openai_url      = 'https://api.openai.com/v1'
end

Yields:

Returns:



26
27
28
# File 'lib/openai/client/configurable.rb', line 26

def configure
  yield(configuration)
end