Get the state history of a thread.
get_history(
self,
thread_id: str,
*,
limit: int = 10,
before: str | Checkpoint | None = None,
metadata: Mapping[str, Any] | None = None,
checkpoint: Checkpoint | None = None,
headers: Mapping[str, str] | None = None,
params: QueryParamTypes | None = None
) -> list[ThreadState]client = get_client(url="http://localhost:2024)
thread_state = await client.threads.get_history(
thread_id="my_thread_id",
limit=5,
)| Name | Type | Description |
|---|---|---|
thread_id* | str | The ID of the thread to get the state history for. |
checkpoint | Checkpoint | None | Default: NoneReturn states for this subgraph. If empty defaults to root. |
limit | int | Default: 10The maximum number of states to return. |
before | str | Checkpoint | None | Default: NoneReturn states before this checkpoint. |
metadata | Mapping[str, Any] | None | Default: NoneFilter states by metadata key-value pairs. |
headers | Mapping[str, str] | None | Default: NoneOptional custom headers to include with the request. |
params | QueryParamTypes | None | Default: NoneOptional query parameters to include with the request. |