langchain
1755750c - fix: more robust tool call limit middleware (#33817)

Commit
178 days ago
fix: more robust tool call limit middleware (#33817) * improving typing (covariance) * adding in support for continuing w/ tool calls not yet at threshold, switching default to continue * moving all logic into after model ```py ExitBehavior = Literal["continue", "error", "end"] """How to handle execution when tool call limits are exceeded. - `"continue"`: Block exceeded tools with error messages, let other tools continue (default) - `"error"`: Raise a `ToolCallLimitExceededError` exception - `"end"`: Stop execution immediately, injecting a ToolMessage and an AI message for the single tool call that exceeded the limit. Raises `NotImplementedError` if there are multiple tool calls """ ```
Author
Parents
Loading