mirror of
https://github.com/hwchase17/langchain.git
synced 2025-06-26 08:33:49 +00:00
community: fix @embeddingKey in azure cosmos db no sql (#27377)
I will keep this PR as small as the changes made. **Description:** fixes a fatal bug syntax error in AzureCosmosDBNoSqlVectorSearch **Issue:** #27269 #25468
This commit is contained in:
parent
06420de2e7
commit
389771ccc0
@ -274,15 +274,15 @@ class AzureCosmosDBNoSqlVectorSearch(VectorStore):
|
||||
query += "TOP @limit "
|
||||
|
||||
query += (
|
||||
"c.id, c.{}, c.text, c.metadata, "
|
||||
"VectorDistance(c.@embeddingKey, @embeddings) AS SimilarityScore FROM c"
|
||||
"c.id, c[@embeddingKey], c.text, c.metadata, "
|
||||
"VectorDistance(c[@embeddingKey], @embeddings) AS SimilarityScore FROM c"
|
||||
)
|
||||
|
||||
# Add where_clause if specified
|
||||
if pre_filter is not None and pre_filter.get("where_clause") is not None:
|
||||
query += " {}".format(pre_filter["where_clause"])
|
||||
|
||||
query += " ORDER BY VectorDistance(c.@embeddingKey, @embeddings)"
|
||||
query += " ORDER BY VectorDistance(c[@embeddingKey], @embeddings)"
|
||||
|
||||
# Add limit_offset_clause if specified
|
||||
if pre_filter is not None and pre_filter.get("limit_offset_clause") is not None:
|
||||
|
Loading…
Reference in New Issue
Block a user