Class: Riffer::Providers::AzureOpenAI
- Defined in:
- lib/riffer/providers/azure_open_ai.rb
Overview
Azure OpenAI provider for GPT models hosted on Azure. Requires the openai gem. Credentials resolve from kwargs, then config, then AZURE_OPENAI_API_KEY / AZURE_OPENAI_ENDPOINT.
Constant Summary
Constants inherited from OpenAI
Constants inherited from Base
Class Method Summary collapse
-
.semconv_provider_name ⇒ Object
The GenAI semconv well-known provider name.
Instance Method Summary collapse
-
#initialize(**options) ⇒ AzureOpenAI
constructor
– : (**untyped) -> void.
Methods inherited from Base
#generate_text, skills_adapter, #stream_text
Constructor Details
#initialize(**options) ⇒ AzureOpenAI
– : (**untyped) -> void
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/riffer/providers/azure_open_ai.rb', line 17 def initialize(**) depends_on "openai" api_key = .fetch(:api_key) { Riffer.config.azure_openai.api_key || ENV["AZURE_OPENAI_API_KEY"] } base_url = .fetch(:base_url) { Riffer.config.azure_openai.endpoint || ENV["AZURE_OPENAI_ENDPOINT"] } @client = ::OpenAI::Client.new( api_key: api_key, base_url: base_url, **.except(:api_key, :base_url) ) end |
Class Method Details
.semconv_provider_name ⇒ Object
The GenAI semconv well-known provider name. – : () -> String
11 12 13 |
# File 'lib/riffer/providers/azure_open_ai.rb', line 11 def self.semconv_provider_name "azure.ai.openai" end |