Class: RubyLlmMesh::Configuration
- Inherits:
-
Object
- Object
- RubyLlmMesh::Configuration
- Defined in:
- lib/ruby_llm_mesh/configuration.rb,
sig/ruby_llm_mesh.rbs
Instance Attribute Summary collapse
-
#anthropic_api_key ⇒ String?
Returns the value of attribute anthropic_api_key.
-
#anthropic_base_url ⇒ String
Returns the value of attribute anthropic_base_url.
-
#anthropic_model ⇒ String
Returns the value of attribute anthropic_model.
-
#circuit_failure_threshold ⇒ Integer
Returns the value of attribute circuit_failure_threshold.
-
#circuit_reset_timeout ⇒ Integer
Returns the value of attribute circuit_reset_timeout.
-
#default_providers ⇒ Array[Symbol]
Returns the value of attribute default_providers.
-
#fallback ⇒ Boolean
Returns the value of attribute fallback.
-
#local_node_base_url ⇒ String
Returns the value of attribute local_node_base_url.
-
#local_node_model ⇒ String
Returns the value of attribute local_node_model.
-
#logger ⇒ Object
Returns the value of attribute logger.
-
#max_retries ⇒ Integer
Returns the value of attribute max_retries.
-
#openai_api_key ⇒ String?
Returns the value of attribute openai_api_key.
-
#openai_base_url ⇒ String
Returns the value of attribute openai_base_url.
-
#openai_model ⇒ String
Returns the value of attribute openai_model.
-
#timeout ⇒ Integer
Returns the value of attribute timeout.
Instance Method Summary collapse
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
Constructor Details
#initialize ⇒ Configuration
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_key ⇒ String?
Returns the value of attribute anthropic_api_key.
5 6 7 |
# File 'lib/ruby_llm_mesh/configuration.rb', line 5 def anthropic_api_key @anthropic_api_key end |
#anthropic_base_url ⇒ String
Returns the value of attribute anthropic_base_url.
5 6 7 |
# File 'lib/ruby_llm_mesh/configuration.rb', line 5 def anthropic_base_url @anthropic_base_url end |
#anthropic_model ⇒ String
Returns the value of attribute anthropic_model.
5 6 7 |
# File 'lib/ruby_llm_mesh/configuration.rb', line 5 def anthropic_model @anthropic_model end |
#circuit_failure_threshold ⇒ Integer
Returns the value of attribute circuit_failure_threshold.
5 6 7 |
# File 'lib/ruby_llm_mesh/configuration.rb', line 5 def circuit_failure_threshold @circuit_failure_threshold end |
#circuit_reset_timeout ⇒ Integer
Returns the value of attribute circuit_reset_timeout.
5 6 7 |
# File 'lib/ruby_llm_mesh/configuration.rb', line 5 def circuit_reset_timeout @circuit_reset_timeout end |
#default_providers ⇒ Array[Symbol]
Returns the value of attribute default_providers.
5 6 7 |
# File 'lib/ruby_llm_mesh/configuration.rb', line 5 def default_providers @default_providers end |
#fallback ⇒ Boolean
Returns the value of attribute fallback.
5 6 7 |
# File 'lib/ruby_llm_mesh/configuration.rb', line 5 def fallback @fallback end |
#local_node_base_url ⇒ String
Returns the value of attribute local_node_base_url.
5 6 7 |
# File 'lib/ruby_llm_mesh/configuration.rb', line 5 def local_node_base_url @local_node_base_url end |
#local_node_model ⇒ String
Returns the value of attribute local_node_model.
5 6 7 |
# File 'lib/ruby_llm_mesh/configuration.rb', line 5 def local_node_model @local_node_model end |
#logger ⇒ Object
Returns the value of attribute logger.
5 6 7 |
# File 'lib/ruby_llm_mesh/configuration.rb', line 5 def logger @logger end |
#max_retries ⇒ Integer
Returns the value of attribute max_retries.
5 6 7 |
# File 'lib/ruby_llm_mesh/configuration.rb', line 5 def max_retries @max_retries end |
#openai_api_key ⇒ String?
Returns the value of attribute openai_api_key.
5 6 7 |
# File 'lib/ruby_llm_mesh/configuration.rb', line 5 def openai_api_key @openai_api_key end |
#openai_base_url ⇒ String
Returns the value of attribute openai_base_url.
5 6 7 |
# File 'lib/ruby_llm_mesh/configuration.rb', line 5 def openai_base_url @openai_base_url end |
#openai_model ⇒ String
Returns the value of attribute openai_model.
5 6 7 |
# File 'lib/ruby_llm_mesh/configuration.rb', line 5 def openai_model @openai_model end |
#timeout ⇒ Integer
Returns the value of attribute timeout.
5 6 7 |
# File 'lib/ruby_llm_mesh/configuration.rb', line 5 def timeout @timeout end |