langchain-postgres 0.0.4__py3-none-any.whl → 0.0.5__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- langchain_postgres/vectorstores.py +13 -1
- {langchain_postgres-0.0.4.dist-info → langchain_postgres-0.0.5.dist-info}/METADATA +1 -1
- {langchain_postgres-0.0.4.dist-info → langchain_postgres-0.0.5.dist-info}/RECORD +5 -5
- {langchain_postgres-0.0.4.dist-info → langchain_postgres-0.0.5.dist-info}/LICENSE +0 -0
- {langchain_postgres-0.0.4.dist-info → langchain_postgres-0.0.5.dist-info}/WHEEL +0 -0
@@ -66,6 +66,7 @@ SPECIAL_CASED_OPERATORS = {
|
|
66
66
|
"$in",
|
67
67
|
"$nin",
|
68
68
|
"$between",
|
69
|
+
"$exists",
|
69
70
|
}
|
70
71
|
|
71
72
|
TEXT_OPERATORS = {
|
@@ -702,13 +703,24 @@ class PGVector(VectorStore):
|
|
702
703
|
if operator in {"$in"}:
|
703
704
|
return queried_field.in_([str(val) for val in filter_value])
|
704
705
|
elif operator in {"$nin"}:
|
705
|
-
return queried_field.
|
706
|
+
return ~queried_field.in_([str(val) for val in filter_value])
|
706
707
|
elif operator in {"$like"}:
|
707
708
|
return queried_field.like(filter_value)
|
708
709
|
elif operator in {"$ilike"}:
|
709
710
|
return queried_field.ilike(filter_value)
|
710
711
|
else:
|
711
712
|
raise NotImplementedError()
|
713
|
+
elif operator == "$exists":
|
714
|
+
if not isinstance(filter_value, bool):
|
715
|
+
raise ValueError(
|
716
|
+
"Expected a boolean value for $exists "
|
717
|
+
f"operator, but got: {filter_value}"
|
718
|
+
)
|
719
|
+
condition = func.jsonb_exists(
|
720
|
+
self.EmbeddingStore.cmetadata,
|
721
|
+
field,
|
722
|
+
)
|
723
|
+
return ~condition if filter_value else condition
|
712
724
|
else:
|
713
725
|
raise NotImplementedError()
|
714
726
|
|
@@ -3,8 +3,8 @@ langchain_postgres/_utils.py,sha256=Johm50HEgA4qScLDaSDIfJfF3DygjA5KTBtNeVcD63I,
|
|
3
3
|
langchain_postgres/chat_message_histories.py,sha256=gh6hjBlrJ5GSo5kePQdh3VhiUYoWWdP37GXtZ1e25a4,14033
|
4
4
|
langchain_postgres/checkpoint.py,sha256=B0c03jyQcS0bAaNPljWEG3IuhlelIF2z3vSXWATi9-4,23519
|
5
5
|
langchain_postgres/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
6
|
-
langchain_postgres/vectorstores.py,sha256
|
7
|
-
langchain_postgres-0.0.
|
8
|
-
langchain_postgres-0.0.
|
9
|
-
langchain_postgres-0.0.
|
10
|
-
langchain_postgres-0.0.
|
6
|
+
langchain_postgres/vectorstores.py,sha256=-oMjtvd9FEANPDk3_97V5MPT__TMRvhibQUrP7q8DQE,50367
|
7
|
+
langchain_postgres-0.0.5.dist-info/LICENSE,sha256=2btS8uNUDWD_UNjw9ba6ZJt_00aUjEw9CGyK-xIHY8c,1072
|
8
|
+
langchain_postgres-0.0.5.dist-info/METADATA,sha256=Z33b8kDnE21iI-LqjsdhsT2OPZLRl_MhfME89xlFSAk,6014
|
9
|
+
langchain_postgres-0.0.5.dist-info/WHEEL,sha256=FMvqSimYX_P7y0a7UY-_Mc83r5zkBZsCYPm7Lr0Bsq4,88
|
10
|
+
langchain_postgres-0.0.5.dist-info/RECORD,,
|
File without changes
|
File without changes
|