| 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: None |
metadata | Mapping[str, Any] | None | Default: None |
select | list[ThreadStateSelectField] | None | Default: None |
headers | Mapping[str, str] | None | Default: None |
params | QueryParamTypes | None | Default: None |
Get the state history of a thread.
client = get_client(url="http://localhost:2024)
thread_state = await client.threads.get_history(
thread_id="my_thread_id",
limit=5,
)Return states before this checkpoint.
Filter states by metadata key-value pairs.
Fields to include in the response. Use values.<key> to
return a single state key (e.g. values.messages), which lets the
server skip loading the rest of the state. Defaults to all fields.
Optional custom headers to include with the request.
Optional query parameters to include with the request.