diff --git a/libs/langchain/langchain/vectorstores/singlestoredb.py b/libs/langchain/langchain/vectorstores/singlestoredb.py index 35a955807f873..657f8093cc849 100644 --- a/libs/langchain/langchain/vectorstores/singlestoredb.py +++ b/libs/langchain/langchain/vectorstores/singlestoredb.py @@ -374,7 +374,9 @@ def build_where_clause( 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,