Skip to content

Commit

Permalink
Merge pull request FlowiseAI#1656 from FlowiseAI/bugfix/Rerank-Top-K
Browse files Browse the repository at this point in the history
Bugfix/Cohere top K
  • Loading branch information
HenryHengZJ authored Feb 1, 2024
2 parents 7e475f1 + 5c6b5b2 commit 48677c3
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export class CohereRerank extends BaseDocumentCompressor {
doc.metadata.relevance_score = result.relevance_score
finalResults.push(doc)
})
return finalResults
return finalResults.splice(0, this.k)
} catch (error) {
return documents
}
Expand Down

0 comments on commit 48677c3

Please sign in to comment.