Class: OllamaAgent::Agent::TurnLoop
- Inherits:
-
Object
- Object
- OllamaAgent::Agent::TurnLoop
- Defined in:
- lib/ollama_agent/agent/turn_loop.rb
Overview
One agent run: budget, loop detection, model round-trips, and tool results.
Instance Method Summary collapse
-
#initialize(agent) ⇒ TurnLoop
constructor
A new instance of TurnLoop.
- #run(messages) ⇒ Object
Constructor Details
#initialize(agent) ⇒ TurnLoop
Returns a new instance of TurnLoop.
9 10 11 12 |
# File 'lib/ollama_agent/agent/turn_loop.rb', line 9 def initialize(agent) @agent = agent @kernel_bridge = Runtime::KernelBridge.new(agent) end |
Instance Method Details
#run(messages) ⇒ Object
14 15 16 17 18 |
# File 'lib/ollama_agent/agent/turn_loop.rb', line 14 def run() setup() @agent.instance_variable_get(:@max_turns).times { break unless run_one_iteration!() } finish() end |