dify/api/tests/unit_tests/core/rag
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
..
cleaner test: unit test cases for rag.cleaner, rag.data_post_processor and rag.datasource (#32521) 2026-03-25 02:19:15 +08:00
data_post_processor chore: reorg imports (#35308) 2026-04-16 08:50:02 +00:00
datasource refactor: use MetadataFilteringCondition BaseModel in RetrievalService.external_retrieve 2026-05-07 10:31:37 +05:30
docstore refactor: migrate SegmentAttachmentBinding to TypeBase (#34810) 2026-04-13 05:22:43 +00:00
embedding chore: reorg imports (#35308) 2026-04-16 08:50:02 +00:00
extractor fix: flaky WordExtractor close test in CI (#35652) 2026-04-29 10:27:02 +08:00
indexing chore: fix use select style api in orm (#35531) 2026-04-24 08:35:20 +00:00
pipeline minor fix(rag): return early when pushing empty tasks to avoid Redis DataError (#28027) 2025-11-13 20:18:11 +08:00
rerank chore: reorg imports (#35308) 2026-04-16 08:50:02 +00:00
retrieval fix(rag): use doc_id dedup key for any provider, not only dify (#35759) 2026-05-05 06:42:18 +00:00
splitter test: unit test for core.rag module (#32630) 2026-03-10 14:10:24 +08:00
__init__.py feat: refactor tongyi models (#3496) 2024-04-15 22:28:32 +08:00