Class: ActiveAgent::Providers::AzureProvider::AzureClient
- Inherits:
-
OpenAI::Client
- Object
- OpenAI::Client
- ActiveAgent::Providers::AzureProvider::AzureClient
- Defined in:
- lib/active_agent/providers/azure_provider.rb
Overview
Custom OpenAI client for Azure OpenAI Service.
Azure uses different authentication headers (api-key instead of Authorization: Bearer) and requires api-version as a query parameter on all requests.
Instance Attribute Summary collapse
- #api_version ⇒ String readonly
Instance Method Summary collapse
-
#initialize(api_key:, base_url:, api_version:, max_retries: self.class::DEFAULT_MAX_RETRIES, timeout: self.class::DEFAULT_TIMEOUT_IN_SECONDS, initial_retry_delay: self.class::DEFAULT_INITIAL_RETRY_DELAY, max_retry_delay: self.class::DEFAULT_MAX_RETRY_DELAY) ⇒ AzureClient
constructor
Creates a new Azure OpenAI client.
Constructor Details
#initialize(api_key:, base_url:, api_version:, max_retries: self.class::DEFAULT_MAX_RETRIES, timeout: self.class::DEFAULT_TIMEOUT_IN_SECONDS, initial_retry_delay: self.class::DEFAULT_INITIAL_RETRY_DELAY, max_retry_delay: self.class::DEFAULT_MAX_RETRY_DELAY) ⇒ AzureClient
Creates a new Azure OpenAI client.
80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 |
# File 'lib/active_agent/providers/azure_provider.rb', line 80 def initialize( api_key:, base_url:, api_version:, max_retries: self.class::DEFAULT_MAX_RETRIES, timeout: self.class::DEFAULT_TIMEOUT_IN_SECONDS, initial_retry_delay: self.class::DEFAULT_INITIAL_RETRY_DELAY, max_retry_delay: self.class::DEFAULT_MAX_RETRY_DELAY ) @api_version = api_version super( api_key: api_key, base_url: base_url, max_retries: max_retries, timeout: timeout, initial_retry_delay: initial_retry_delay, max_retry_delay: max_retry_delay ) end |
Instance Attribute Details
#api_version ⇒ String (readonly)
69 70 71 |
# File 'lib/active_agent/providers/azure_provider.rb', line 69 def api_version @api_version end |