Thanks for the response.
I’ve thought about using the modelCallLimitMiddleware or toolCallLimitMiddleware, but I could thought about the right number I should give them (to end after N counts). Do you have any tip on how can I calculate it correctly? Let’s say that I want to limit by recursionLimit of 50.
Do you have any examples for the other suggestions?
For streaming, I suppose this is an example for what you meant. Don’t we’ll have the same problem? AIMessage and ToolMessage doesn’t have any correlation to recursionLimit