mirror of
https://github.com/hwchase17/langchain.git
synced 2025-06-04 22:23:50 +00:00
Fix SingleStoreDB (#10534)
After the refactoring #6570, the DistanceStrategy class was moved to another module and this introduced a bug into the SingleStoreDB vector store, as the `DistanceStrategy.EUCLEDIAN_DISTANCE` started to convert into the 'DistanceStrategy.EUCLEDIAN_DISTANCE' string, instead of just 'EUCLEDIAN_DISTANCE' (same for 'DOT_PRODUCT'). In this change, I check the type of the parameter and use `.name` attribute to get the correct object's name. --------- Co-authored-by: Volodymyr Tkachuk <vtkachuk-ua@singlestore.com>
This commit is contained in:
parent
f9636b6cd2
commit
a43abf24e4
@ -374,7 +374,9 @@ class SingleStoreDB(VectorStore):
|
||||
FROM {} {} ORDER BY __score {} LIMIT %s""".format(
|
||||
self.content_field,
|
||||
self.metadata_field,
|
||||
self.distance_strategy,
|
||||
self.distance_strategy.name
|
||||
if isinstance(self.distance_strategy, DistanceStrategy)
|
||||
else self.distance_strategy,
|
||||
self.vector_field,
|
||||
self.table_name,
|
||||
where_clause,
|
||||
|
Loading…
Reference in New Issue
Block a user