mirror of
https://github.com/langchain-ai/langchain.git
synced 2026-10-13 13:19:22 +03:00
A `@field_serializer` takes the field's one serializer slot, so any subclass declaring its own serializer for `func`, `coroutine` or `args_schema` would fail at class creation with `PydanticUserError: Multiple field serializer functions were defined`. Those subclasses were valid before this PR. `PlainSerializer` in the field's `Annotated` metadata leaves the decorator slot free: a subclass serializer is accepted and takes precedence. Output, dump options and CPU cost are unchanged (0.014 ms vs 0.134 ms on master for a 12-tool payload, byte-identical). Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>