Class: Riffer::Providers::OpenAI
- Defined in:
- lib/riffer/providers/open_ai.rb
Overview
OpenAI provider for GPT models.
Requires the openai gem to be installed.
Instance Method Summary collapse
-
#initialize(**options) ⇒ OpenAI
constructor
Initializes the OpenAI provider.
Methods inherited from Base
Methods included from Messages::Converter
Constructor Details
#initialize(**options) ⇒ OpenAI
Initializes the OpenAI provider.
- options
-
Hash - optional client options
Use :api_key to override Riffer.config.openai.api_key.
12 13 14 15 16 17 |
# File 'lib/riffer/providers/open_ai.rb', line 12 def initialize(**) depends_on "openai" api_key = .fetch(:api_key, Riffer.config.openai.api_key) @client = ::OpenAI::Client.new(api_key: api_key, **.except(:api_key)) end |