refactor(api): replace dict/Mapping with TypedDict in core/rag retrieval_service.py (#33615)

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
This commit is contained in:
BitToby
2026-03-18 04:49:09 +02:00
committed by GitHub
parent d7f70f3c0f
commit 485da15a4d
18 changed files with 165 additions and 71 deletions

View File

@ -510,7 +510,7 @@ class TestWorkflowConverter:
retrieve_strategy=DatasetRetrieveConfigEntity.RetrieveStrategy.MULTIPLE,
top_k=10,
score_threshold=0.8,
reranking_model={"provider": "cohere", "model": "rerank-v2"},
reranking_model={"reranking_provider_name": "cohere", "reranking_model_name": "rerank-v2"},
reranking_enabled=True,
),
)
@ -543,8 +543,8 @@ class TestWorkflowConverter:
multiple_config = node["data"]["multiple_retrieval_config"]
assert multiple_config["top_k"] == 10
assert multiple_config["score_threshold"] == 0.8
assert multiple_config["reranking_model"]["provider"] == "cohere"
assert multiple_config["reranking_model"]["model"] == "rerank-v2"
assert multiple_config["reranking_model"]["reranking_provider_name"] == "cohere"
assert multiple_config["reranking_model"]["reranking_model_name"] == "rerank-v2"
# Verify single retrieval config is None for multiple strategy
assert node["data"]["single_retrieval_config"] is None