get_tuple(
self,
config: RunnableConfig,
) -> CheckpointTuple | None| Name | Type | Description |
|---|---|---|
config* | RunnableConfig | The config to use for retrieving the checkpoint. |
Get a checkpoint tuple from the database.
This method retrieves a checkpoint tuple from the SQLite database based on the
provided config. If the config contains a checkpoint_id key, the checkpoint with
the matching thread ID and checkpoint ID is retrieved. Otherwise, the latest checkpoint
for the given thread ID is retrieved.
Examples:
Basic:
config = {"configurable": {"thread_id": "1"}} checkpoint_tuple = memory.get_tuple(config) print(checkpoint_tuple) CheckpointTuple(...)
With checkpoint ID:
config = { ... "configurable": { ... "thread_id": "1", ... "checkpoint_ns": "", ... "checkpoint_id": "1ef4f797-8335-6428-8001-8a1503f9b875", ... } ... } checkpoint_tuple = memory.get_tuple(config) print(checkpoint_tuple) CheckpointTuple(...)