Class: Llm::Clients::AzureOpenAi
- Defined in:
- lib/llm/clients/azure_open_ai.rb
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
-
#initialize(timeout: 30000) ⇒ AzureOpenAi
constructor
A new instance of AzureOpenAi.
Methods inherited from Base
#chat, #chat_with_function_calling_loop
Constructor Details
#initialize(timeout: 30000) ⇒ AzureOpenAi
Returns a new instance of AzureOpenAi.
4 5 6 7 8 9 10 11 12 |
# File 'lib/llm/clients/azure_open_ai.rb', line 4 def initialize(timeout: 30000) @client = OpenAI::Client.new( api_type: :azure, api_version: ENV.fetch("AZURE_API_VERSION"), access_token: ENV.fetch("AZURE_OPENAI_API_KEY"), uri_base: "#{ENV.fetch("AZURE_API_BASE")}/openai/deployments/#{ENV.fetch("AZURE_DEPLOYMENT_NAME")}", request_timeout: timeout, ) end |