mirror of
https://github.com/infiniflow/ragflow.git
synced 2026-06-29 23:41:12 +08:00
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:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user