run_until
Method
This is a method of the Agent class in the agent module.Run agent iteratively until output meets quality criteria. This method implements the “Ralph Loop” pattern: run agent → judge output → improve based on feedback → repeat until threshold met.
Signature
Parameters
The prompt to send to the agent
Evaluation criteria for the Judge (e.g., “Response is thorough”)
Score threshold for success (default: 8.0, scale 1-10)
Maximum iterations before stopping (default: 5)
“optimize” (stop on success) or “review” (run all iterations)
Optional callback called after each iteration
Enable verbose logging
Returns
EvaluationLoopResult with iteration history and final score
Usage
Uses
EvaluationLooploop.run
Source
View on GitHub
praisonaiagents/agent/agent.py at line 2371
