In OrchestrationChatModel method call an agentic loop calls the LLM and - if requested by response.hasToolCalls() - calls tools. And passes the tool results back to LLM.
Is there a feature available to set a "max iteration" value that the loop ends automatically if this limit is reached, just to prevent infinite loops with LLM and Tool calls?
In Langchain4J a maxIteration value can be given to a loop builder: https://github.com/langchain4j/langchain4j/blob/main/docs/docs/tutorials/agents.md#loop-workflow
In
OrchestrationChatModelmethodcallan agentic loop calls the LLM and - if requested byresponse.hasToolCalls()- calls tools. And passes the tool results back to LLM.Is there a feature available to set a "max iteration" value that the loop ends automatically if this limit is reached, just to prevent infinite loops with LLM and Tool calls?
In Langchain4J a
maxIterationvalue can be given to a loop builder: https://github.com/langchain4j/langchain4j/blob/main/docs/docs/tutorials/agents.md#loop-workflow