mirror of
https://github.com/langgenius/dify.git
synced 2026-05-13 08:57:28 +08:00
Follow the dict -> Pydantic BaseModel pattern established by #31514, #34080 and #34422: RetrievalService.external_retrieve now accepts metadata_filtering_conditions: MetadataFilteringCondition | None directly instead of dict[str, Any] | None. The redundant internal MetadataFilteringCondition.model_validate(...) call is removed; validation now happens at the call site in HitTestingService.external_retrieve, following the "validate at the boundary" principle cited in the issue. Unit tests are updated to pass typed instances where appropriate and a regression test is added for the None path. Behavior is otherwise preserved. external_retrieval_model is left as dict[str, Any] because it is an opaque payload forwarded to external retrieval providers. Fixes part of #31497. |
||
|---|---|---|
| .. | ||
| keyword | ||
| vdb | ||
| __init__.py | ||
| retrieval_service.py | ||