dify/api/tests
gaurav0107 02fa84d853 refactor: use MetadataFilteringCondition BaseModel in RetrievalService.external_retrieve
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.
2026-05-07 10:31:37 +05:30
..
fixtures/workflow fix(api): defer streaming response until referenced variables are updated (#30832) 2026-01-12 16:23:18 +08:00
integration_tests chore: fix use select style api in orm (#35531) 2026-04-24 08:35:20 +00:00
test_containers_integration_tests refactor: add type to test (#30873) 2026-05-07 03:46:23 +00:00
unit_tests refactor: use MetadataFilteringCondition BaseModel in RetrievalService.external_retrieve 2026-05-07 10:31:37 +05:30
__init__.py refactor: move vdb implementations to workspaces (#34900) 2026-04-13 08:56:43 +00:00
conftest.py refactor(workflow-file): move core.file to core.workflow.file (#32252) 2026-02-16 22:38:19 +08:00
workflow_test_utils.py chore: reorg imports (#35308) 2026-04-16 08:50:02 +00:00