Class: LlmClient::Configuration
- Inherits:
-
Object
- Object
- LlmClient::Configuration
- Defined in:
- lib/llm_client/configuration.rb
Overview
The Configuration class allows you to configure the connection settings for the LlmClient. It can be initialized directly calling #new method.
Examples
configuration = LlmClient::Configuration.new
configurarion.host = "http://localhost:9292"
Or via a setup block.
Examples
LlmClient::Configuration.setup do |config|
config.host = "https://localhost:9292"
end
Instance Attribute Summary collapse
-
#host ⇒ Object
Sets the host name for the Llm.
-
#log_level ⇒ Object
Sets the logger’s log level for the LlmClient.
-
#logger ⇒ Object
Sets the logger for the LlmClient.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
53 54 55 |
# File 'lib/llm_client/configuration.rb', line 53 def initialize @log_level = LlmClient::LEVEL_INFO end |
Instance Attribute Details
#host ⇒ Object
Sets the host name for the Llm.
Examples
config.host = "chroma.example.com"
Returns the String host name.
27 28 29 |
# File 'lib/llm_client/configuration.rb', line 27 def host @host end |
#log_level ⇒ Object
Sets the logger’s log level for the LlmClient.
Examples
config.log_level = LlmClient::LEVEL_INFO
Returns the log level constant
45 46 47 |
# File 'lib/llm_client/configuration.rb', line 45 def log_level @log_level end |
#logger ⇒ Object
Sets the logger for the LlmClient.
Examples
config.logger = Logger.new(STDOUT)
Returns the Logger instance.
36 37 38 |
# File 'lib/llm_client/configuration.rb', line 36 def logger @logger end |
Class Method Details
.setup ⇒ Object
47 48 49 50 51 |
# File 'lib/llm_client/configuration.rb', line 47 def self.setup new.tap do |instance| yield(instance) if block_given? end end |