Unfazed Checkpointer
unfazed-checkoutpointer is a unfazed plugin for langgraph.
important:
- only support async methods now.
- only support mysql/tidb protocol now.
reference docs:
Usage
Install unfazed-checkpointer
make sure you already installed unfazed
pip install unfazed-checkpointer
Migrate the DB
currently we only support mysql or tidb
# for the first migration
unfazed-cli init-db
# for the upgrade
unfazed-cli migrate
unfazed-cli upgrade
Use it in your code
import uuid
from langchain_core.runnables import RunnableConfig
from langgraph.graph import END, START, StateGraph
from langgraph.types import Command as LangGraphCommand
from langgraph.types import interrupt
from unfazed_checkpointer.services import TortoiseCheckpointSaver
# ==================== State & Nodes ====================
class SimpleState(t.TypedDict):
foo: str
bar: t.Annotated[list[str], operator.add]
class InterruptState(t.TypedDict):
foo: str
bar: t.Annotated[list[str], operator.add]
def interrupt_node(state: InterruptState) -> dict[str, t.Any]:
"""Runs second, interrupts and modifies foo on resume."""
approved = interrupt("Do you want to proceed?")
return {"foo": f"a-approved:{approved}", "bar": ["a"]}
async def main():
workflow = StateGraph(SimpleState)
workflow.add_node("node", interrupt_node)
workflow.add_edge(START, "node")
workflow.add_edge("node", END)
checkpointer = TortoiseCheckpointSaver()
graph = workflow.compile(checkpointer=checkpointer)
thread_id = str(uuid.uuid4())
config: RunnableConfig = {"configurable": {"thread_id": thread_id}}
await graph.ainvoke(
t.cast(SimpleState, {"foo": "init", "bar": ["init"]}), config
)
Metadata
Release files for unfazed-checkpointer 0.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| unfazed_checkpointer-0.0.1.tar.gz | 95.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| unfazed_checkpointer-0.0.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 104.8 kB
Release files / unfazed_checkpointer-0.0.1.tar.gz
| Download URL | unfazed_checkpointer-0.0.1.tar.gz |
|---|---|
| Size | 95.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
80ce7d00dfd9532213999f94fb96eeceac5dceabb37e5384747edf661250377c
|
|
BLAKE2b-256 checksum How to use checksums |
399f1d8fed41da88627806e18022a2582c062473e5066ebaee409e87b31ab6d3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.10.2 {"installer":{"name":"uv","version":"0.10.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / unfazed_checkpointer-0.0.1-py3-none-any.whl
| Download URL | unfazed_checkpointer-0.0.1-py3-none-any.whl |
|---|---|
| Size | 9.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
a852370cef137077e485049be1ea479b29bfafbdb5a395a47c39e9d39f000063
|
|
BLAKE2b-256 checksum How to use checksums |
4cadd1cfad061d16e4f07ad3d4a25a00d2c36ee448c55385017bd211814cb002
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.10.2 {"installer":{"name":"uv","version":"0.10.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|