Class: SolidAgents::Agents::Base
- Inherits:
-
RubyLLM::Agent
- Object
- RubyLLM::Agent
- SolidAgents::Agents::Base
- Defined in:
- app/solid_agents/agents/base.rb
Instance Attribute Summary collapse
-
#context ⇒ Object
readonly
Returns the value of attribute context.
-
#owner ⇒ Object
readonly
Returns the value of attribute owner.
-
#run ⇒ Object
readonly
Returns the value of attribute run.
Instance Method Summary collapse
- #call(prompt) ⇒ Object
-
#initialize(run:, context:, owner:) ⇒ Base
constructor
A new instance of Base.
- #instructions ⇒ Object
Constructor Details
#initialize(run:, context:, owner:) ⇒ Base
Returns a new instance of Base.
11 12 13 14 15 16 |
# File 'app/solid_agents/agents/base.rb', line 11 def initialize(run:, context:, owner:) @run = run @context = context @owner = owner.to_s super() end |
Instance Attribute Details
#context ⇒ Object (readonly)
Returns the value of attribute context.
9 10 11 |
# File 'app/solid_agents/agents/base.rb', line 9 def context @context end |
#owner ⇒ Object (readonly)
Returns the value of attribute owner.
9 10 11 |
# File 'app/solid_agents/agents/base.rb', line 9 def owner @owner end |
#run ⇒ Object (readonly)
Returns the value of attribute run.
9 10 11 |
# File 'app/solid_agents/agents/base.rb', line 9 def run @run end |
Instance Method Details
#call(prompt) ⇒ Object
18 19 20 |
# File 'app/solid_agents/agents/base.rb', line 18 def call(prompt) ask(prompt) end |
#instructions ⇒ Object
22 23 24 25 |
# File 'app/solid_agents/agents/base.rb', line 22 def instructions template_path = File.("../prompts/#{owner}/instructions.txt.erb", __dir__) ERB.new(File.read(template_path)).result(binding) end |