Commit 8d267e9
Nit: use plain setattr in strip_disabled_fields
The previous object.__setattr__ was defensive bypass-validation, but every
field in DISABLED_SAMPLING_PARAMS is declared as `<type> | None = None` on the
underlying langchain subclasses, so None is always valid. `strip_disabled_fields`
runs inside `@model_validator(mode="after")` and operates on the constructed
pydantic model, so plain setattr already goes through `BaseModel.__setattr__`
and respects field types. If a future caller tries to disable a non-nullable
custom field, raising is the right behavior — better than silently bypassing.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent afe4a3e commit 8d267e9
1 file changed
Lines changed: 1 addition & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
132 | 132 | | |
133 | 133 | | |
134 | 134 | | |
135 | | - | |
136 | | - | |
137 | | - | |
| 135 | + | |
0 commit comments