mirror of
https://github.com/meta-llama/llama-stack.git
synced 2025-12-03 18:00:36 +00:00
fix(mongodb): cap numCandidates at 1000, raise on index failure, and add models_api dependency
This commit is contained in:
parent
ab824b53e3
commit
1b75792621
1 changed files with 1 additions and 1 deletions
|
|
@ -215,7 +215,7 @@ class MongoDBIndex(EmbeddingIndex):
|
||||||
"index": self.config.index_name,
|
"index": self.config.index_name,
|
||||||
"queryVector": embedding.tolist(),
|
"queryVector": embedding.tolist(),
|
||||||
"path": self.config.path_field,
|
"path": self.config.path_field,
|
||||||
"numCandidates": k * 10, # Get more candidates for better results
|
"numCandidates": min(k * 10, 1000), # Cap at 1000 to prevent excessive candidates
|
||||||
"limit": k,
|
"limit": k,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue