Class: DebugAgent::LLMConfig
- Inherits:
-
Struct
- Object
- Struct
- DebugAgent::LLMConfig
- Defined in:
- lib/debug_agent/config.rb
Instance Attribute Summary collapse
-
#api_key ⇒ Object
Returns the value of attribute api_key.
-
#base_url ⇒ Object
Returns the value of attribute base_url.
-
#context_window_tokens ⇒ Object
Returns the value of attribute context_window_tokens.
-
#max_retries ⇒ Object
Returns the value of attribute max_retries.
-
#max_tokens ⇒ Object
Returns the value of attribute max_tokens.
-
#max_tool_rounds ⇒ Object
Returns the value of attribute max_tool_rounds.
-
#model ⇒ Object
Returns the value of attribute model.
-
#retry_base_delay_ms ⇒ Object
Returns the value of attribute retry_base_delay_ms.
-
#retry_max_delay_ms ⇒ Object
Returns the value of attribute retry_max_delay_ms.
-
#temperature ⇒ Object
Returns the value of attribute temperature.
-
#timeout_seconds ⇒ Object
Returns the value of attribute timeout_seconds.
Instance Method Summary collapse
Instance Attribute Details
#api_key ⇒ Object
Returns the value of attribute api_key
2 3 4 |
# File 'lib/debug_agent/config.rb', line 2 def api_key @api_key end |
#base_url ⇒ Object
Returns the value of attribute base_url
2 3 4 |
# File 'lib/debug_agent/config.rb', line 2 def base_url @base_url end |
#context_window_tokens ⇒ Object
Returns the value of attribute context_window_tokens
2 3 4 |
# File 'lib/debug_agent/config.rb', line 2 def context_window_tokens @context_window_tokens end |
#max_retries ⇒ Object
Returns the value of attribute max_retries
2 3 4 |
# File 'lib/debug_agent/config.rb', line 2 def max_retries @max_retries end |
#max_tokens ⇒ Object
Returns the value of attribute max_tokens
2 3 4 |
# File 'lib/debug_agent/config.rb', line 2 def max_tokens @max_tokens end |
#max_tool_rounds ⇒ Object
Returns the value of attribute max_tool_rounds
2 3 4 |
# File 'lib/debug_agent/config.rb', line 2 def max_tool_rounds @max_tool_rounds end |
#model ⇒ Object
Returns the value of attribute model
2 3 4 |
# File 'lib/debug_agent/config.rb', line 2 def model @model end |
#retry_base_delay_ms ⇒ Object
Returns the value of attribute retry_base_delay_ms
2 3 4 |
# File 'lib/debug_agent/config.rb', line 2 def retry_base_delay_ms @retry_base_delay_ms end |
#retry_max_delay_ms ⇒ Object
Returns the value of attribute retry_max_delay_ms
2 3 4 |
# File 'lib/debug_agent/config.rb', line 2 def retry_max_delay_ms @retry_max_delay_ms end |
#temperature ⇒ Object
Returns the value of attribute temperature
2 3 4 |
# File 'lib/debug_agent/config.rb', line 2 def temperature @temperature end |
#timeout_seconds ⇒ Object
Returns the value of attribute timeout_seconds
2 3 4 |
# File 'lib/debug_agent/config.rb', line 2 def timeout_seconds @timeout_seconds end |
Instance Method Details
#defaults! ⇒ Object
8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/debug_agent/config.rb', line 8 def defaults! self.base_url ||= ENV.fetch('LLM_BASE_URL', 'https://open.bigmodel.cn/api/coding/paas/v4') self.api_key ||= ENV.fetch('LLM_API_KEY', ENV.fetch('OPENAI_API_KEY', '')) self.model ||= ENV.fetch('LLM_MODEL', 'glm-5.2') self.temperature ||= 0.3 self.max_tokens ||= 4096 self.max_tool_rounds ||= 25 self.timeout_seconds ||= 120 self.max_retries ||= 3 self.retry_base_delay_ms ||= 1000 self.retry_max_delay_ms ||= 30000 self.context_window_tokens ||= 100_000 self end |