Class: Soka::Engines::Base
- Inherits:
-
Object
- Object
- Soka::Engines::Base
- Defined in:
- lib/soka/engines/base.rb
Overview
Base class for reasoning engines
Direct Known Subclasses
Instance Attribute Summary collapse
-
#agent ⇒ Object
readonly
Returns the value of attribute agent.
-
#custom_instructions ⇒ Object
readonly
Returns the value of attribute custom_instructions.
-
#llm ⇒ Object
readonly
Returns the value of attribute llm.
-
#max_iterations ⇒ Object
readonly
Returns the value of attribute max_iterations.
-
#think_in ⇒ Object
readonly
Returns the value of attribute think_in.
-
#tools ⇒ Object
readonly
Returns the value of attribute tools.
Instance Method Summary collapse
-
#initialize(agent, tools, **options) ⇒ Base
constructor
A new instance of Base.
- #reason(task) ⇒ Object
Constructor Details
#initialize(agent, tools, **options) ⇒ Base
Returns a new instance of Base.
9 10 11 12 13 14 15 16 |
# File 'lib/soka/engines/base.rb', line 9 def initialize(agent, tools, **) @agent = agent @tools = tools @llm = [:llm] @max_iterations = [:max_iterations] || 10 @custom_instructions = [:custom_instructions] @think_in = [:think_in] end |
Instance Attribute Details
#agent ⇒ Object (readonly)
Returns the value of attribute agent.
7 8 9 |
# File 'lib/soka/engines/base.rb', line 7 def agent @agent end |
#custom_instructions ⇒ Object (readonly)
Returns the value of attribute custom_instructions.
7 8 9 |
# File 'lib/soka/engines/base.rb', line 7 def custom_instructions @custom_instructions end |
#llm ⇒ Object (readonly)
Returns the value of attribute llm.
7 8 9 |
# File 'lib/soka/engines/base.rb', line 7 def llm @llm end |
#max_iterations ⇒ Object (readonly)
Returns the value of attribute max_iterations.
7 8 9 |
# File 'lib/soka/engines/base.rb', line 7 def max_iterations @max_iterations end |
#think_in ⇒ Object (readonly)
Returns the value of attribute think_in.
7 8 9 |
# File 'lib/soka/engines/base.rb', line 7 def think_in @think_in end |
#tools ⇒ Object (readonly)
Returns the value of attribute tools.
7 8 9 |
# File 'lib/soka/engines/base.rb', line 7 def tools @tools end |
Instance Method Details
#reason(task) ⇒ Object
18 19 20 |
# File 'lib/soka/engines/base.rb', line 18 def reason(task) raise NotImplementedError, "#{self.class} must implement #reason method" end |