- If the model generates a new query, enter the next round of retrieval;
- If the model has output the final answer, terminate the process.
The Router Server is the partner of the branch structure. It is responsible for judging the current state and returning a state label to drive the process direction.
If you do not yet know how to implement a Router Tool, please refer to Router Server.
Usage Example
examples/rag_branch.yaml
branch: Declares the starting point of a branch structure;router: Specifies the Router Tool used for judging branch logic, which needs to return a state label (such as incomplete / complete);branches: Defines the sequence of execution steps corresponding to each state. The key is the state label, which must be consistent with the state value returned by the Router Tool; the value is the list of steps to be executed under that state (can be empty, indicating process termination).