主题
重排序
文档重排序接口,用于 RAG 检索召回后的结果再排序,显著提升最终答案质量。
基础调用
bash
curl https://api.nassaapi.xyz/rerank \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $YOUR_API_KEY" \
-d '{
"model": "bge-reranker-v2-m3",
"query": "VitePress 如何自定义主题色?",
"documents": [
"VitePress 支持通过覆盖 CSS 变量自定义主题色。",
"Vite 是一款前端构建工具。",
"VitePress 的 default theme 提供 --vp-c-brand-1 等变量。"
],
"top_n": 2
}'返回结构
json
{
"results": [
{ "index": 0, "relevance_score": 0.97 },
{ "index": 2, "relevance_score": 0.88 }
]
}