BaseCheckpointer
llmfy.flow_engine.checkpointer.base_checkpointer
CheckpointMetadata
dataclass
Metadata for a checkpoint.
Source code in llmfy/flow_engine/checkpointer/base_checkpointer.py
checkpoint_id
instance-attribute
session_id
instance-attribute
timestamp
instance-attribute
node_name
instance-attribute
step
instance-attribute
__init__(checkpoint_id, session_id, timestamp, node_name, step)
Checkpoint
dataclass
Represents a saved state checkpoint.
Source code in llmfy/flow_engine/checkpointer/base_checkpointer.py
metadata
instance-attribute
state
instance-attribute
__init__(metadata, state)
to_dict()
Convert checkpoint to dictionary for storage.
Source code in llmfy/flow_engine/checkpointer/base_checkpointer.py
from_dict(data)
classmethod
Create checkpoint from dictionary.
Source code in llmfy/flow_engine/checkpointer/base_checkpointer.py
BaseCheckpointer
Bases: ABC
Base class for checkpoint storage backends.
Source code in llmfy/flow_engine/checkpointer/base_checkpointer.py
save(checkpoint)
abstractmethod
async
Save a checkpoint.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
checkpoint
|
Checkpoint
|
The checkpoint to save |
required |
load(session_id, checkpoint_id=None)
abstractmethod
async
Load a checkpoint.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
session_id
|
str
|
The session ID |
required |
checkpoint_id
|
Optional[str]
|
Specific checkpoint ID, or None for latest |
None
|
Returns:
| Type | Description |
|---|---|
Optional[Checkpoint]
|
The checkpoint if found, None otherwise |
Source code in llmfy/flow_engine/checkpointer/base_checkpointer.py
list(session_id, limit=10)
abstractmethod
async
List checkpoints for a thread.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
session_id
|
str
|
The session ID |
required |
limit
|
int
|
Maximum number of checkpoints to return |
10
|
Returns:
| Type | Description |
|---|---|
List[Checkpoint]
|
List of checkpoints, newest first |
Source code in llmfy/flow_engine/checkpointer/base_checkpointer.py
delete(session_id, checkpoint_id=None)
abstractmethod
async
Delete checkpoint(s).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
session_id
|
str
|
The session ID |
required |
checkpoint_id
|
Optional[str]
|
Specific checkpoint ID, or None to delete all for thread |
None
|