Class: Llm::Clients::OpenAi
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
-
#initialize(timeout: 300) ⇒ OpenAi
constructor
A new instance of OpenAi.
Methods inherited from Base
#chat, #chat_with_function_calling_loop
Constructor Details
#initialize(timeout: 300) ⇒ OpenAi
Returns a new instance of OpenAi.
4 5 6 7 8 9 10 11 |
# File 'lib/llm/clients/open_ai.rb', line 4 def initialize(timeout: 300) @client = OpenAI::Client.new( api_version: ENV.fetch("OPENAI_API_VERSION"), access_token: ENV.fetch("OPENAI_API_KEY"), uri_base: "https://openai.com/openai/deployments/chat/completions", request_timeout: timeout, ) end |