mirror of
https://github.com/hwchase17/langchain.git
synced 2026-07-11 01:01:41 +00:00
fix docstring
This commit is contained in:
@@ -54,10 +54,15 @@ class ToolErrorMiddleware(AgentMiddleware[AgentState[ResponseT], ContextT, Respo
|
||||
placed *inner* and configured with `on_failure="error"` so exceptions reach this
|
||||
middleware.
|
||||
|
||||
This middleware only sees exceptions raised by tool *execution*. Argument-binding
|
||||
and validation errors are handled upstream by `ToolNode` (converted to an error
|
||||
`ToolMessage` before the tool runs), so they do not pass through `catch` or
|
||||
`on_error` and are not sanitized by `on_error`.
|
||||
|
||||
Guidance on what to `catch`:
|
||||
|
||||
- **Catch** (return to the model): anticipated, model-actionable, non-sensitive
|
||||
errors — e.g. validation errors or tool-domain errors the model can correct.
|
||||
errors raised by the tool — e.g. tool-domain errors the model can correct.
|
||||
- **Do not catch** (let propagate): programming bugs, auth/permission errors, and
|
||||
anything whose message may carry secrets or internal infrastructure detail.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user