langgraph-checkpoint-postgres 2.0.15__tar.gz → 2.0.16__tar.gz
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.
- {langgraph_checkpoint_postgres-2.0.15 → langgraph_checkpoint_postgres-2.0.16}/PKG-INFO +1 -1
- {langgraph_checkpoint_postgres-2.0.15 → langgraph_checkpoint_postgres-2.0.16}/langgraph/store/postgres/aio.py +2 -2
- {langgraph_checkpoint_postgres-2.0.15 → langgraph_checkpoint_postgres-2.0.16}/langgraph/store/postgres/base.py +6 -6
- {langgraph_checkpoint_postgres-2.0.15 → langgraph_checkpoint_postgres-2.0.16}/pyproject.toml +1 -1
- {langgraph_checkpoint_postgres-2.0.15 → langgraph_checkpoint_postgres-2.0.16}/README.md +0 -0
- {langgraph_checkpoint_postgres-2.0.15 → langgraph_checkpoint_postgres-2.0.16}/langgraph/checkpoint/postgres/__init__.py +0 -0
- {langgraph_checkpoint_postgres-2.0.15 → langgraph_checkpoint_postgres-2.0.16}/langgraph/checkpoint/postgres/_ainternal.py +0 -0
- {langgraph_checkpoint_postgres-2.0.15 → langgraph_checkpoint_postgres-2.0.16}/langgraph/checkpoint/postgres/_internal.py +0 -0
- {langgraph_checkpoint_postgres-2.0.15 → langgraph_checkpoint_postgres-2.0.16}/langgraph/checkpoint/postgres/aio.py +0 -0
- {langgraph_checkpoint_postgres-2.0.15 → langgraph_checkpoint_postgres-2.0.16}/langgraph/checkpoint/postgres/base.py +0 -0
- {langgraph_checkpoint_postgres-2.0.15 → langgraph_checkpoint_postgres-2.0.16}/langgraph/checkpoint/postgres/py.typed +0 -0
- {langgraph_checkpoint_postgres-2.0.15 → langgraph_checkpoint_postgres-2.0.16}/langgraph/checkpoint/postgres/shallow.py +0 -0
- {langgraph_checkpoint_postgres-2.0.15 → langgraph_checkpoint_postgres-2.0.16}/langgraph/store/postgres/__init__.py +0 -0
- {langgraph_checkpoint_postgres-2.0.15 → langgraph_checkpoint_postgres-2.0.16}/langgraph/store/postgres/py.typed +0 -0
|
@@ -20,7 +20,7 @@ from langgraph.store.base import (
|
|
|
20
20
|
)
|
|
21
21
|
from langgraph.store.base.batch import AsyncBatchedBaseStore
|
|
22
22
|
from langgraph.store.postgres.base import (
|
|
23
|
-
|
|
23
|
+
PLACEHOLDER,
|
|
24
24
|
BasePostgresStore,
|
|
25
25
|
PoolConfig,
|
|
26
26
|
PostgresIndexConfig,
|
|
@@ -360,7 +360,7 @@ class AsyncPostgresStore(AsyncBatchedBaseStore, BasePostgresStore[_ainternal.Con
|
|
|
360
360
|
for (idx, _), vector in zip(embedding_requests, vectors):
|
|
361
361
|
_paramslist = queries[idx][1]
|
|
362
362
|
for i in range(len(_paramslist)):
|
|
363
|
-
if _paramslist[i] is
|
|
363
|
+
if _paramslist[i] is PLACEHOLDER:
|
|
364
364
|
_paramslist[i] = vector
|
|
365
365
|
|
|
366
366
|
for (idx, _), (query, params) in zip(search_ops, queries):
|
|
@@ -370,7 +370,7 @@ class BasePostgresStore(Generic[C]):
|
|
|
370
370
|
if op.query and self.index_config:
|
|
371
371
|
embedding_requests.append((idx, op.query))
|
|
372
372
|
|
|
373
|
-
score_operator, post_operator =
|
|
373
|
+
score_operator, post_operator = get_distance_operator(self)
|
|
374
374
|
vector_type = (
|
|
375
375
|
cast(PostgresIndexConfig, self.index_config)
|
|
376
376
|
.get("ann_index_config", {})
|
|
@@ -430,10 +430,10 @@ class BasePostgresStore(Generic[C]):
|
|
|
430
430
|
OFFSET %s
|
|
431
431
|
"""
|
|
432
432
|
params = [
|
|
433
|
-
|
|
433
|
+
PLACEHOLDER, # Vector placeholder
|
|
434
434
|
*ns_args,
|
|
435
435
|
*filter_params,
|
|
436
|
-
|
|
436
|
+
PLACEHOLDER,
|
|
437
437
|
expanded_limit,
|
|
438
438
|
op.limit,
|
|
439
439
|
op.offset,
|
|
@@ -828,7 +828,7 @@ class PostgresStore(BaseStore, BasePostgresStore[_pg_internal.Conn]):
|
|
|
828
828
|
for (idx, _), embedding in zip(embedding_requests, embeddings):
|
|
829
829
|
_paramslist = queries[idx][1]
|
|
830
830
|
for i in range(len(_paramslist)):
|
|
831
|
-
if _paramslist[i] is
|
|
831
|
+
if _paramslist[i] is PLACEHOLDER:
|
|
832
832
|
_paramslist[i] = embedding
|
|
833
833
|
|
|
834
834
|
for (idx, _), (query, params) in zip(search_ops, queries):
|
|
@@ -1055,7 +1055,7 @@ def _decode_ns_bytes(namespace: Union[str, bytes, list]) -> tuple[str, ...]:
|
|
|
1055
1055
|
return tuple(namespace.split("."))
|
|
1056
1056
|
|
|
1057
1057
|
|
|
1058
|
-
def
|
|
1058
|
+
def get_distance_operator(store: Any) -> tuple[str, str]:
|
|
1059
1059
|
"""Get the distance operator and score expression based on config."""
|
|
1060
1060
|
# Note: Today, we are not using ANN indices due to restrictions
|
|
1061
1061
|
# on PGVector's support for mixing vector and non-vector filters
|
|
@@ -1121,4 +1121,4 @@ def _ensure_index_config(
|
|
|
1121
1121
|
return embeddings, index_config
|
|
1122
1122
|
|
|
1123
1123
|
|
|
1124
|
-
|
|
1124
|
+
PLACEHOLDER = object()
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|