Class: RubyLlmMesh::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/ruby_llm_mesh/configuration.rb,
sig/ruby_llm_mesh.rbs

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

Returns a new instance of Configuration.



12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# File 'lib/ruby_llm_mesh/configuration.rb', line 12

def initialize
  @default_providers = %i[openai anthropic local_node]
  @fallback = true
  @timeout = 30
  @max_retries = 1

  @openai_api_key = ENV.fetch("OPENAI_API_KEY", nil)
  @openai_base_url = ENV.fetch("OPENAI_BASE_URL", "https://api.openai.com/v1")
  @openai_model = ENV.fetch("OPENAI_MODEL", "gpt-4o-mini")

  @anthropic_api_key = ENV.fetch("ANTHROPIC_API_KEY", nil)
  @anthropic_base_url = ENV.fetch("ANTHROPIC_BASE_URL", "https://api.anthropic.com")
  @anthropic_model = ENV.fetch("ANTHROPIC_MODEL", "claude-sonnet-4-5")

  @local_node_base_url = ENV.fetch("LOCAL_NODE_BASE_URL", "http://127.0.0.1:11434")
  @local_node_model = ENV.fetch("LOCAL_NODE_MODEL", "llama3.2")

  @circuit_failure_threshold = 3
  @circuit_reset_timeout = 60
  @logger = nil
end

Instance Attribute Details

#anthropic_api_keyString?

Returns the value of attribute anthropic_api_key.

Returns:

  • (String, nil)


5
6
7
# File 'lib/ruby_llm_mesh/configuration.rb', line 5

def anthropic_api_key
  @anthropic_api_key
end

#anthropic_base_urlString

Returns the value of attribute anthropic_base_url.

Returns:

  • (String)


5
6
7
# File 'lib/ruby_llm_mesh/configuration.rb', line 5

def anthropic_base_url
  @anthropic_base_url
end

#anthropic_modelString

Returns the value of attribute anthropic_model.

Returns:

  • (String)


5
6
7
# File 'lib/ruby_llm_mesh/configuration.rb', line 5

def anthropic_model
  @anthropic_model
end

#circuit_failure_thresholdInteger

Returns the value of attribute circuit_failure_threshold.

Returns:

  • (Integer)


5
6
7
# File 'lib/ruby_llm_mesh/configuration.rb', line 5

def circuit_failure_threshold
  @circuit_failure_threshold
end

#circuit_reset_timeoutInteger

Returns the value of attribute circuit_reset_timeout.

Returns:

  • (Integer)


5
6
7
# File 'lib/ruby_llm_mesh/configuration.rb', line 5

def circuit_reset_timeout
  @circuit_reset_timeout
end

#default_providersArray[Symbol]

Returns the value of attribute default_providers.

Returns:

  • (Array[Symbol])


5
6
7
# File 'lib/ruby_llm_mesh/configuration.rb', line 5

def default_providers
  @default_providers
end

#fallbackBoolean

Returns the value of attribute fallback.

Returns:

  • (Boolean)


5
6
7
# File 'lib/ruby_llm_mesh/configuration.rb', line 5

def fallback
  @fallback
end

#local_node_base_urlString

Returns the value of attribute local_node_base_url.

Returns:

  • (String)


5
6
7
# File 'lib/ruby_llm_mesh/configuration.rb', line 5

def local_node_base_url
  @local_node_base_url
end

#local_node_modelString

Returns the value of attribute local_node_model.

Returns:

  • (String)


5
6
7
# File 'lib/ruby_llm_mesh/configuration.rb', line 5

def local_node_model
  @local_node_model
end

#loggerObject

Returns the value of attribute logger.

Returns:

  • (Object)


5
6
7
# File 'lib/ruby_llm_mesh/configuration.rb', line 5

def logger
  @logger
end

#max_retriesInteger

Returns the value of attribute max_retries.

Returns:

  • (Integer)


5
6
7
# File 'lib/ruby_llm_mesh/configuration.rb', line 5

def max_retries
  @max_retries
end

#openai_api_keyString?

Returns the value of attribute openai_api_key.

Returns:

  • (String, nil)


5
6
7
# File 'lib/ruby_llm_mesh/configuration.rb', line 5

def openai_api_key
  @openai_api_key
end

#openai_base_urlString

Returns the value of attribute openai_base_url.

Returns:

  • (String)


5
6
7
# File 'lib/ruby_llm_mesh/configuration.rb', line 5

def openai_base_url
  @openai_base_url
end

#openai_modelString

Returns the value of attribute openai_model.

Returns:

  • (String)


5
6
7
# File 'lib/ruby_llm_mesh/configuration.rb', line 5

def openai_model
  @openai_model
end

#timeoutInteger

Returns the value of attribute timeout.

Returns:

  • (Integer)


5
6
7
# File 'lib/ruby_llm_mesh/configuration.rb', line 5

def timeout
  @timeout
end