Skip to content

Hi, could you provide more examples of how to control the loop? #19

@1panzi

Description

@1panzi
 Your example states that the agent follows the workflow LLM → call_func → LLM. However, I’d like to understand the stopping conditions—specifically, how and when the agent terminates based on is_last_step or result_is_true parameters. In my current implementation, the agent only executes once instead of looping as expected.

I'm implementing a workflow where:
The LLM generates text output
A validation function (check_result) evaluates this output
If invalid, the process repeats until either:
Validation passes, or
Maximum repetitions (max_repeat) is reached

Initially, I implemented this using manual graph construction (add_node/add_edges), but now I want to transition to a ReAct agent architecture for better maintainability and performance.

Could you advise on:
Best practices for implementing this validation loop in a ReAct agent framework?
How to properly configure the termination conditions (successful validation or max_repeat)?
Any framework-specific considerations I should be aware of?"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions