diff --git a/libs/checkpoint-postgres/langgraph/checkpoint/postgres/__init__.py b/libs/checkpoint-postgres/langgraph/checkpoint/postgres/__init__.py index 3b33e0a9f..87241259c 100644 --- a/libs/checkpoint-postgres/langgraph/checkpoint/postgres/__init__.py +++ b/libs/checkpoint-postgres/langgraph/checkpoint/postgres/__init__.py @@ -323,8 +323,14 @@ class PostgresSaver(BasePostgresSaver): k: v for k, v in config["configurable"].items() if not k.startswith("__") + and isinstance(v, (str, int, bool, float)) + }, + **{ + k: v + for k, v in config.get("metadata", {}).items() + if not k.startswith("__") + and isinstance(v, (str, int, bool, float)) }, - **config.get("metadata", {}), **metadata, } ), diff --git a/libs/checkpoint-postgres/langgraph/checkpoint/postgres/aio.py b/libs/checkpoint-postgres/langgraph/checkpoint/postgres/aio.py index 596ce1de5..abfeb8a60 100644 --- a/libs/checkpoint-postgres/langgraph/checkpoint/postgres/aio.py +++ b/libs/checkpoint-postgres/langgraph/checkpoint/postgres/aio.py @@ -281,8 +281,14 @@ class AsyncPostgresSaver(BasePostgresSaver): k: v for k, v in config["configurable"].items() if not k.startswith("__") + and isinstance(v, (str, int, bool, float)) + }, + **{ + k: v + for k, v in config.get("metadata", {}).items() + if not k.startswith("__") + and isinstance(v, (str, int, bool, float)) }, - **config.get("metadata", {}), **metadata, } ), diff --git a/libs/checkpoint-postgres/langgraph/checkpoint/postgres/shallow.py b/libs/checkpoint-postgres/langgraph/checkpoint/postgres/shallow.py index decf25bfd..53c092e68 100644 --- a/libs/checkpoint-postgres/langgraph/checkpoint/postgres/shallow.py +++ b/libs/checkpoint-postgres/langgraph/checkpoint/postgres/shallow.py @@ -429,8 +429,14 @@ class ShallowPostgresSaver(BasePostgresSaver): k: v for k, v in config["configurable"].items() if not k.startswith("__") + and isinstance(v, (str, int, bool, float)) + }, + **{ + k: v + for k, v in config.get("metadata", {}).items() + if not k.startswith("__") + and isinstance(v, (str, int, bool, float)) }, - **config.get("metadata", {}), **metadata, } ), @@ -758,8 +764,14 @@ class AsyncShallowPostgresSaver(BasePostgresSaver): k: v for k, v in config["configurable"].items() if not k.startswith("__") + and isinstance(v, (str, int, bool, float)) + }, + **{ + k: v + for k, v in config.get("metadata", {}).items() + if not k.startswith("__") + and isinstance(v, (str, int, bool, float)) }, - **config.get("metadata", {}), **metadata, } ), diff --git a/libs/checkpoint-postgres/pyproject.toml b/libs/checkpoint-postgres/pyproject.toml index 32b56f089..3bf01d676 100644 --- a/libs/checkpoint-postgres/pyproject.toml +++ b/libs/checkpoint-postgres/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "langgraph-checkpoint-postgres" -version = "2.0.14" +version = "2.0.15" description = "Library with a Postgres implementation of LangGraph checkpoint saver." authors = [] license = "MIT" diff --git a/libs/checkpoint-sqlite/langgraph/checkpoint/sqlite/__init__.py b/libs/checkpoint-sqlite/langgraph/checkpoint/sqlite/__init__.py index 2587a70b4..6dfa876d5 100644 --- a/libs/checkpoint-sqlite/langgraph/checkpoint/sqlite/__init__.py +++ b/libs/checkpoint-sqlite/langgraph/checkpoint/sqlite/__init__.py @@ -402,9 +402,13 @@ class SqliteSaver(BaseCheckpointSaver[str]): **{ k: v for k, v in config["configurable"].items() - if not k.startswith("__") + if not k.startswith("__") and isinstance(v, (str, int, bool, float)) + }, + **{ + k: v + for k, v in config.get("metadata", {}).items() + if not k.startswith("__") and isinstance(v, (str, int, bool, float)) }, - **config.get("metadata", {}), **metadata, } ) diff --git a/libs/checkpoint-sqlite/langgraph/checkpoint/sqlite/aio.py b/libs/checkpoint-sqlite/langgraph/checkpoint/sqlite/aio.py index 338ce0e47..e4862c130 100644 --- a/libs/checkpoint-sqlite/langgraph/checkpoint/sqlite/aio.py +++ b/libs/checkpoint-sqlite/langgraph/checkpoint/sqlite/aio.py @@ -468,9 +468,13 @@ class AsyncSqliteSaver(BaseCheckpointSaver[str]): **{ k: v for k, v in config["configurable"].items() - if not k.startswith("__") + if not k.startswith("__") and isinstance(v, (str, int, bool, float)) + }, + **{ + k: v + for k, v in config.get("metadata", {}).items() + if not k.startswith("__") and isinstance(v, (str, int, bool, float)) }, - **config.get("metadata", {}), **metadata, } ) diff --git a/libs/checkpoint-sqlite/pyproject.toml b/libs/checkpoint-sqlite/pyproject.toml index 50150b471..1eeeeed3a 100644 --- a/libs/checkpoint-sqlite/pyproject.toml +++ b/libs/checkpoint-sqlite/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "langgraph-checkpoint-sqlite" -version = "2.0.4" +version = "2.0.5" description = "Library with a SQLite implementation of LangGraph checkpoint saver." authors = [] license = "MIT" diff --git a/libs/checkpoint/langgraph/checkpoint/memory/__init__.py b/libs/checkpoint/langgraph/checkpoint/memory/__init__.py index 855ced952..e7b81d324 100644 --- a/libs/checkpoint/langgraph/checkpoint/memory/__init__.py +++ b/libs/checkpoint/langgraph/checkpoint/memory/__init__.py @@ -362,8 +362,14 @@ class InMemorySaver( k: v for k, v in config["configurable"].items() if not k.startswith("__") + and isinstance(v, (str, int, bool, float)) + }, + **{ + k: v + for k, v in config.get("metadata", {}).items() + if not k.startswith("__") + and isinstance(v, (str, int, bool, float)) }, - **config.get("metadata", {}), **metadata, } ), diff --git a/libs/checkpoint/pyproject.toml b/libs/checkpoint/pyproject.toml index 10ebf1a24..2f137faad 100644 --- a/libs/checkpoint/pyproject.toml +++ b/libs/checkpoint/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "langgraph-checkpoint" -version = "2.0.14" +version = "2.0.15" description = "Library with base interfaces for LangGraph checkpoint savers." authors = [] license = "MIT"