Go: fix siliconflow rerank issue (#14743)

### What problem does this PR solve?

As title.

### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)

Signed-off-by: Jin Hai <haijin.chn@gmail.com>
This commit is contained in:
Jin Hai
2026-05-09 20:45:53 +08:00
committed by GitHub
parent 779cd83862
commit 048ec2fc5c

View File

@@ -657,11 +657,16 @@ func (s *SiliconflowModel) Rerank(modelName *string, query string, documents []s
apiKey = *apiConfig.ApiKey
}
var topN = rerankConfig.TopN
if rerankConfig.TopN == 0 {
topN = len(documents)
}
reqBody := SiliconflowRerankRequest{
Model: *modelName,
Query: query,
Documents: documents,
TopN: rerankConfig.TopN,
TopN: topN,
ReturnDocuments: false,
MaxChunksPerDoc: 1024,
OverlapTokens: 80,