langgraph-checkpoint-sqlite 2.0.1__tar.gz → 2.0.2__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_sqlite-2.0.1 → langgraph_checkpoint_sqlite-2.0.2}/PKG-INFO +1 -1
- {langgraph_checkpoint_sqlite-2.0.1 → langgraph_checkpoint_sqlite-2.0.2}/langgraph/checkpoint/sqlite/__init__.py +1 -1
- {langgraph_checkpoint_sqlite-2.0.1 → langgraph_checkpoint_sqlite-2.0.2}/langgraph/checkpoint/sqlite/aio.py +14 -2
- {langgraph_checkpoint_sqlite-2.0.1 → langgraph_checkpoint_sqlite-2.0.2}/pyproject.toml +1 -1
- {langgraph_checkpoint_sqlite-2.0.1 → langgraph_checkpoint_sqlite-2.0.2}/README.md +0 -0
- {langgraph_checkpoint_sqlite-2.0.1 → langgraph_checkpoint_sqlite-2.0.2}/langgraph/checkpoint/sqlite/py.typed +0 -0
- {langgraph_checkpoint_sqlite-2.0.1 → langgraph_checkpoint_sqlite-2.0.2}/langgraph/checkpoint/sqlite/utils.py +0 -0
|
@@ -137,7 +137,7 @@ class AsyncSqliteSaver(BaseCheckpointSaver[str]):
|
|
|
137
137
|
AsyncSqliteSaver: A new AsyncSqliteSaver instance.
|
|
138
138
|
"""
|
|
139
139
|
async with aiosqlite.connect(conn_string) as conn:
|
|
140
|
-
yield
|
|
140
|
+
yield cls(conn)
|
|
141
141
|
|
|
142
142
|
def get_tuple(self, config: RunnableConfig) -> Optional[CheckpointTuple]:
|
|
143
143
|
"""Get a checkpoint tuple from the database.
|
|
@@ -159,7 +159,7 @@ class AsyncSqliteSaver(BaseCheckpointSaver[str]):
|
|
|
159
159
|
if asyncio.get_running_loop() is self.loop:
|
|
160
160
|
raise asyncio.InvalidStateError(
|
|
161
161
|
"Synchronous calls to AsyncSqliteSaver are only allowed from a "
|
|
162
|
-
"different thread. From the main thread, use the async interface."
|
|
162
|
+
"different thread. From the main thread, use the async interface. "
|
|
163
163
|
"For example, use `await checkpointer.aget_tuple(...)` or `await "
|
|
164
164
|
"graph.ainvoke(...)`."
|
|
165
165
|
)
|
|
@@ -191,6 +191,18 @@ class AsyncSqliteSaver(BaseCheckpointSaver[str]):
|
|
|
191
191
|
Yields:
|
|
192
192
|
Iterator[CheckpointTuple]: An iterator of matching checkpoint tuples.
|
|
193
193
|
"""
|
|
194
|
+
try:
|
|
195
|
+
# check if we are in the main thread, only bg threads can block
|
|
196
|
+
# we don't check in other methods to avoid the overhead
|
|
197
|
+
if asyncio.get_running_loop() is self.loop:
|
|
198
|
+
raise asyncio.InvalidStateError(
|
|
199
|
+
"Synchronous calls to AsyncSqliteSaver are only allowed from a "
|
|
200
|
+
"different thread. From the main thread, use the async interface. "
|
|
201
|
+
"For example, use `checkpointer.alist(...)` or `await "
|
|
202
|
+
"graph.ainvoke(...)`."
|
|
203
|
+
)
|
|
204
|
+
except RuntimeError:
|
|
205
|
+
pass
|
|
194
206
|
aiter_ = self.alist(config, filter=filter, before=before, limit=limit)
|
|
195
207
|
while True:
|
|
196
208
|
try:
|
|
File without changes
|
|
File without changes
|
|
File without changes
|