mirror of
https://github.com/langchain-ai/langchain.git
synced 2026-10-05 09:25:14 +03:00
chore(langchain): update docs on error handling for json schema (#39632)
This commit is contained in:
1 parent
cde529347a
commit
a2f02abedb
1 file changed
+9
@@ -219,6 +219,15 @@ class ToolStrategy(Generic[SchemaT]):
|
||||
message
|
||||
- `Callable[[Exception], str]`: Custom function that returns error message
|
||||
- `False`: No retry, let exceptions propagate
|
||||
|
||||
!!! warning "Raw JSON schema dicts are not validated"
|
||||
When `schema` is a raw JSON schema `dict` (as opposed to a Pydantic model,
|
||||
`dataclass`, or `TypedDict`), the model's tool-call arguments are returned
|
||||
**as-is without validation** against the schema.
|
||||
|
||||
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.
|
||||
"""
|
||||
|
||||
def __init__(
|
||||
|
||||
Reference in new issue
Block a user