Class: LlmClient::Configuration

Inherits:
Object
  • Object
show all
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

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

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

#hostObject

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_levelObject

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

#loggerObject

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

.setupObject



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