mirror of
https://github.com/infiniflow/ragflow.git
synced 2025-12-06 11:57:23 +00:00
### What problem does this PR solve?
change:
Randomly sample `check_num` chunks from knowledge base `kb_id`, re-embed
them using `embd_id`, and compare with stored vectors via cosine
similarity. If `avg_cos_sim > 0.99`, return success (`code=0`);
otherwise return business failure (`code=10`).
url:
`/v1/kb/check_embedding`
Request Body:
```
{
"kb_id": "<dataset_id>",
"embd_id": "BAAI/bge-m3@SILICONFLOW",
"check_num": 5
}
```
Success Response:
```
{
"code": 0,
"message": "success",
"data": {
"summary": { "avg_cos_sim": 0.999999, "sampled": 5, "valid": 5, "max_cos_sim":0.999999,"min_cos_sim":0.999999,"model":"BAAI/bge-m3@SILICONFLOW" },
"results": [ ... ]
}
}
```
### Type of change
- [x] New Feature (non-breaking change which adds functionality)