chore(langchain): update docs on error handling for json schema - #39632
Conversation
| As a result, `handle_errors` is effectively inert for dict schemas. To get | ||
| validation and automatic retries, express the schema as a Pydantic model, | ||
| `dataclass`, or `TypedDict` instead. |
There was a problem hiding this comment.
🔵 Warning incorrectly says all error handling is inert
handle_errors still handles MultipleStructuredOutputsError for raw dict schemas: _handle_model_output invokes _handle_structured_output_error before parsing the schema whenever the model returns multiple structured tool calls. Calling the option “effectively inert” therefore tells dict-schema users that custom messages/retries will never run even though they do for this reachable error path. Please scope the warning specifically to schema-validation errors and retries.
(Refers to lines 228-230)
Your feedback helps Open SWE learn. React with 👍 or 👎 to tell us if this review comment was useful.
| As a result, `handle_errors` is effectively inert for dict schemas. To get | |
| validation and automatic retries, express the schema as a Pydantic model, | |
| `dataclass`, or `TypedDict` instead. | |
| As a result, `handle_errors` cannot catch schema-validation errors or retry | |
| schema-invalid output for dict schemas. To get that validation and automatic | |
| retry behavior, express the schema as a Pydantic model, `dataclass`, or `TypedDict`. |
Merging this PR will not alter performance
Comparing Footnotes
|
Resolves #38719.