bug: fixed bedrock rerank bug (#12774)

Co-authored-by: hobo.l <hobo.l@binance.com>
This commit is contained in:
luckylhb90 2025-01-21 14:09:36 +03:00 committed by GitHub
parent 6db3ae9b8e
commit 3d1ce4c53f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -70,7 +70,7 @@ class BedrockRerankModel(RerankModel):
rerankingConfiguration = {
"type": "BEDROCK_RERANKING_MODEL",
"bedrockRerankingConfiguration": {
"numberOfResults": top_n,
"numberOfResults": min(top_n, len(text_sources)),
"modelConfiguration": {
"modelArn": model_package_arn,
},