Class: ActiveAgent::Providers::AzureProvider
- Inherits:
-
OpenAI::ChatProvider
- Object
- BaseProvider
- OpenAI::Base
- OpenAI::ChatProvider
- ActiveAgent::Providers::AzureProvider
- Defined in:
- lib/active_agent/providers/azure_provider.rb
Overview
Provider for Azure OpenAI Service via OpenAI-compatible API.
Azure OpenAI uses the same API structure as OpenAI but with different authentication (api-key header) and endpoint configuration (resource + deployment).
Defined Under Namespace
Classes: AzureClient
Class Method Summary collapse
- .embed_request_type ⇒ ActiveModel::Type::Value
- .options_klass ⇒ Class
- .prompt_request_type ⇒ ActiveModel::Type::Value
- .service_name ⇒ String
Instance Method Summary collapse
-
#client ⇒ AzureClient
Returns a configured Azure OpenAI client.
Methods included from ToolChoiceClearing
Methods inherited from BaseProvider
#embed, #initialize, namespace, #preview, #prompt, tag_name
Methods included from Previewable
Methods included from Instrumentation
#instrumentation_prompt_payload
Methods included from ExceptionHandler
#configure_exception_handler, #rescue_with_handler, #with_exception_handling
Constructor Details
This class inherits a constructor from ActiveAgent::Providers::BaseProvider
Class Method Details
.embed_request_type ⇒ ActiveModel::Type::Value
41 42 43 |
# File 'lib/active_agent/providers/azure_provider.rb', line 41 def self. OpenAI::Embedding::RequestType.new end |
.options_klass ⇒ Class
31 32 33 |
# File 'lib/active_agent/providers/azure_provider.rb', line 31 def self. Azure::Options end |
.prompt_request_type ⇒ ActiveModel::Type::Value
36 37 38 |
# File 'lib/active_agent/providers/azure_provider.rb', line 36 def self.prompt_request_type OpenAI::Chat::RequestType.new end |
.service_name ⇒ String
26 27 28 |
# File 'lib/active_agent/providers/azure_provider.rb', line 26 def self.service_name "AzureOpenAI" end |
Instance Method Details
#client ⇒ AzureClient
Returns a configured Azure OpenAI client.
Uses a custom client subclass that handles Azure-specific authentication (api-key header instead of Authorization: Bearer).
51 52 53 54 55 56 57 58 59 60 61 |
# File 'lib/active_agent/providers/azure_provider.rb', line 51 def client @client ||= AzureClient.new( api_key: .api_key, base_url: .base_url, api_version: .api_version, max_retries: .max_retries, timeout: .timeout, initial_retry_delay: .initial_retry_delay, max_retry_delay: .max_retry_delay ) end |