langgraph-checkpoint-postgres 2.0.14__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.14 → langgraph_checkpoint_postgres-2.0.16}/PKG-INFO +2 -2
- {langgraph_checkpoint_postgres-2.0.14 → langgraph_checkpoint_postgres-2.0.16}/langgraph/checkpoint/postgres/__init__.py +2 -11
- {langgraph_checkpoint_postgres-2.0.14 → langgraph_checkpoint_postgres-2.0.16}/langgraph/checkpoint/postgres/aio.py +2 -11
- {langgraph_checkpoint_postgres-2.0.14 → langgraph_checkpoint_postgres-2.0.16}/langgraph/checkpoint/postgres/shallow.py +3 -22
- {langgraph_checkpoint_postgres-2.0.14 → langgraph_checkpoint_postgres-2.0.16}/langgraph/store/postgres/aio.py +2 -2
- {langgraph_checkpoint_postgres-2.0.14 → langgraph_checkpoint_postgres-2.0.16}/langgraph/store/postgres/base.py +6 -6
- {langgraph_checkpoint_postgres-2.0.14 → langgraph_checkpoint_postgres-2.0.16}/pyproject.toml +9 -3
- {langgraph_checkpoint_postgres-2.0.14 → langgraph_checkpoint_postgres-2.0.16}/README.md +0 -0
- {langgraph_checkpoint_postgres-2.0.14 → langgraph_checkpoint_postgres-2.0.16}/langgraph/checkpoint/postgres/_ainternal.py +0 -0
- {langgraph_checkpoint_postgres-2.0.14 → langgraph_checkpoint_postgres-2.0.16}/langgraph/checkpoint/postgres/_internal.py +0 -0
- {langgraph_checkpoint_postgres-2.0.14 → langgraph_checkpoint_postgres-2.0.16}/langgraph/checkpoint/postgres/base.py +0 -0
- {langgraph_checkpoint_postgres-2.0.14 → langgraph_checkpoint_postgres-2.0.16}/langgraph/checkpoint/postgres/py.typed +0 -0
- {langgraph_checkpoint_postgres-2.0.14 → langgraph_checkpoint_postgres-2.0.16}/langgraph/store/postgres/__init__.py +0 -0
- {langgraph_checkpoint_postgres-2.0.14 → langgraph_checkpoint_postgres-2.0.16}/langgraph/store/postgres/py.typed +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: langgraph-checkpoint-postgres
|
|
3
|
-
Version: 2.0.
|
|
3
|
+
Version: 2.0.16
|
|
4
4
|
Summary: Library with a Postgres implementation of LangGraph checkpoint saver.
|
|
5
5
|
Home-page: https://www.github.com/langchain-ai/langgraph
|
|
6
6
|
License: MIT
|
|
@@ -11,7 +11,7 @@ Classifier: Programming Language :: Python :: 3.9
|
|
|
11
11
|
Classifier: Programming Language :: Python :: 3.10
|
|
12
12
|
Classifier: Programming Language :: Python :: 3.11
|
|
13
13
|
Classifier: Programming Language :: Python :: 3.12
|
|
14
|
-
Requires-Dist: langgraph-checkpoint (>=2.0.
|
|
14
|
+
Requires-Dist: langgraph-checkpoint (>=2.0.15,<3.0.0)
|
|
15
15
|
Requires-Dist: orjson (>=3.10.1)
|
|
16
16
|
Requires-Dist: psycopg (>=3.2.0,<4.0.0)
|
|
17
17
|
Requires-Dist: psycopg-pool (>=3.2.0,<4.0.0)
|
|
@@ -16,6 +16,7 @@ from langgraph.checkpoint.base import (
|
|
|
16
16
|
CheckpointMetadata,
|
|
17
17
|
CheckpointTuple,
|
|
18
18
|
get_checkpoint_id,
|
|
19
|
+
get_checkpoint_metadata,
|
|
19
20
|
)
|
|
20
21
|
from langgraph.checkpoint.postgres import _internal
|
|
21
22
|
from langgraph.checkpoint.postgres.base import BasePostgresSaver
|
|
@@ -317,17 +318,7 @@ class PostgresSaver(BasePostgresSaver):
|
|
|
317
318
|
checkpoint["id"],
|
|
318
319
|
checkpoint_id,
|
|
319
320
|
Jsonb(self._dump_checkpoint(copy)),
|
|
320
|
-
self._dump_metadata(
|
|
321
|
-
{
|
|
322
|
-
**{
|
|
323
|
-
k: v
|
|
324
|
-
for k, v in config["configurable"].items()
|
|
325
|
-
if not k.startswith("__")
|
|
326
|
-
},
|
|
327
|
-
**config.get("metadata", {}),
|
|
328
|
-
**metadata,
|
|
329
|
-
}
|
|
330
|
-
),
|
|
321
|
+
self._dump_metadata(get_checkpoint_metadata(config, metadata)),
|
|
331
322
|
),
|
|
332
323
|
)
|
|
333
324
|
return next_config
|
|
@@ -16,6 +16,7 @@ from langgraph.checkpoint.base import (
|
|
|
16
16
|
CheckpointMetadata,
|
|
17
17
|
CheckpointTuple,
|
|
18
18
|
get_checkpoint_id,
|
|
19
|
+
get_checkpoint_metadata,
|
|
19
20
|
)
|
|
20
21
|
from langgraph.checkpoint.postgres import _ainternal
|
|
21
22
|
from langgraph.checkpoint.postgres.base import BasePostgresSaver
|
|
@@ -275,17 +276,7 @@ class AsyncPostgresSaver(BasePostgresSaver):
|
|
|
275
276
|
checkpoint["id"],
|
|
276
277
|
checkpoint_id,
|
|
277
278
|
Jsonb(self._dump_checkpoint(copy)),
|
|
278
|
-
self._dump_metadata(
|
|
279
|
-
{
|
|
280
|
-
**{
|
|
281
|
-
k: v
|
|
282
|
-
for k, v in config["configurable"].items()
|
|
283
|
-
if not k.startswith("__")
|
|
284
|
-
},
|
|
285
|
-
**config.get("metadata", {}),
|
|
286
|
-
**metadata,
|
|
287
|
-
}
|
|
288
|
-
),
|
|
279
|
+
self._dump_metadata(get_checkpoint_metadata(config, metadata)),
|
|
289
280
|
),
|
|
290
281
|
)
|
|
291
282
|
return next_config
|
|
@@ -24,6 +24,7 @@ from langgraph.checkpoint.base import (
|
|
|
24
24
|
Checkpoint,
|
|
25
25
|
CheckpointMetadata,
|
|
26
26
|
CheckpointTuple,
|
|
27
|
+
get_checkpoint_metadata,
|
|
27
28
|
)
|
|
28
29
|
from langgraph.checkpoint.postgres import _ainternal, _internal
|
|
29
30
|
from langgraph.checkpoint.postgres.base import BasePostgresSaver
|
|
@@ -423,17 +424,7 @@ class ShallowPostgresSaver(BasePostgresSaver):
|
|
|
423
424
|
thread_id,
|
|
424
425
|
checkpoint_ns,
|
|
425
426
|
Jsonb(self._dump_checkpoint(copy)),
|
|
426
|
-
self._dump_metadata(
|
|
427
|
-
{
|
|
428
|
-
**{
|
|
429
|
-
k: v
|
|
430
|
-
for k, v in config["configurable"].items()
|
|
431
|
-
if not k.startswith("__")
|
|
432
|
-
},
|
|
433
|
-
**config.get("metadata", {}),
|
|
434
|
-
**metadata,
|
|
435
|
-
}
|
|
436
|
-
),
|
|
427
|
+
self._dump_metadata(get_checkpoint_metadata(config, metadata)),
|
|
437
428
|
),
|
|
438
429
|
)
|
|
439
430
|
return next_config
|
|
@@ -752,17 +743,7 @@ class AsyncShallowPostgresSaver(BasePostgresSaver):
|
|
|
752
743
|
thread_id,
|
|
753
744
|
checkpoint_ns,
|
|
754
745
|
Jsonb(self._dump_checkpoint(copy)),
|
|
755
|
-
self._dump_metadata(
|
|
756
|
-
{
|
|
757
|
-
**{
|
|
758
|
-
k: v
|
|
759
|
-
for k, v in config["configurable"].items()
|
|
760
|
-
if not k.startswith("__")
|
|
761
|
-
},
|
|
762
|
-
**config.get("metadata", {}),
|
|
763
|
-
**metadata,
|
|
764
|
-
}
|
|
765
|
-
),
|
|
746
|
+
self._dump_metadata(get_checkpoint_metadata(config, metadata)),
|
|
766
747
|
),
|
|
767
748
|
)
|
|
768
749
|
return next_config
|
|
@@ -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()
|
{langgraph_checkpoint_postgres-2.0.14 → langgraph_checkpoint_postgres-2.0.16}/pyproject.toml
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[tool.poetry]
|
|
2
2
|
name = "langgraph-checkpoint-postgres"
|
|
3
|
-
version = "2.0.
|
|
3
|
+
version = "2.0.16"
|
|
4
4
|
description = "Library with a Postgres implementation of LangGraph checkpoint saver."
|
|
5
5
|
authors = []
|
|
6
6
|
license = "MIT"
|
|
@@ -10,7 +10,7 @@ packages = [{ include = "langgraph" }]
|
|
|
10
10
|
|
|
11
11
|
[tool.poetry.dependencies]
|
|
12
12
|
python = "^3.9.0,<4.0"
|
|
13
|
-
langgraph-checkpoint = "^2.0.
|
|
13
|
+
langgraph-checkpoint = "^2.0.15"
|
|
14
14
|
orjson = ">=3.10.1"
|
|
15
15
|
psycopg = "^3.2.0"
|
|
16
16
|
psycopg-pool = "^3.2.0"
|
|
@@ -22,10 +22,10 @@ pytest = "^7.2.1"
|
|
|
22
22
|
anyio = "^4.4.0"
|
|
23
23
|
pytest-asyncio = "^0.21.1"
|
|
24
24
|
pytest-mock = "^3.11.1"
|
|
25
|
-
pytest-watch = "^4.2.0"
|
|
26
25
|
mypy = "^1.10.0"
|
|
27
26
|
psycopg = {extras = ["binary"], version = ">=3.0.0"}
|
|
28
27
|
langgraph-checkpoint = {path = "../checkpoint", develop = true}
|
|
28
|
+
pytest-watcher = "^0.4.3"
|
|
29
29
|
|
|
30
30
|
[tool.pytest.ini_options]
|
|
31
31
|
# --strict-markers will raise errors on unknown marks.
|
|
@@ -61,3 +61,9 @@ warn_unused_ignores = "True"
|
|
|
61
61
|
warn_redundant_casts = "True"
|
|
62
62
|
allow_redefinition = "True"
|
|
63
63
|
disable_error_code = "typeddict-item, return-value"
|
|
64
|
+
|
|
65
|
+
[tool.pytest-watcher]
|
|
66
|
+
now = true
|
|
67
|
+
delay = 0.1
|
|
68
|
+
runner_args = ["--ff", "-x", "-v", "--tb", "short"]
|
|
69
|
+
patterns = ["*.py"]
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|