Skip to content

Commit

Permalink
community[patch]: fix bugs in baiduvectordb as vectorstore (langchain…
Browse files Browse the repository at this point in the history
…-ai#19380)

fix small bugs in vectorstore/baiduvectordb
  • Loading branch information
fengjial authored and chrispy-snps committed Mar 30, 2024
1 parent 56a8852 commit 1212ab7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion docs/docs/integrations/vectorstores/baiduvectordb.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
")\n",
"\n",
"vector_db = BaiduVectorDB.from_documents(\n",
" docs, embeddings, connection_params=conn_params, drop=True\n",
" docs, embeddings, connection_params=conn_params, drop_old=True\n",
")"
]
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@ def _create_table(self, table_name: str) -> None:
self.field_vector,
self.mochowenum.FieldType.FLOAT_VECTOR,
dimension=self.table_params.dimension,
not_null=True,
)
)
fields.append(schema.Field(self.field_text, self.mochowenum.FieldType.STRING))
Expand Down Expand Up @@ -358,7 +359,7 @@ def _similarity_search_with_score(
doc = Document(
page_content=row_data.get(self.field_text), metadata=meta
)
pair = (doc, result.get("distance", 0.0))
pair = (doc, result.get("score", 0.0))
ret.append(pair)
return ret

Expand Down

0 comments on commit 1212ab7

Please sign in to comment.