Client for managing threads in LangGraph.
A thread maintains the state of a graph across multiple interactions/invocations (aka runs). It accumulates and persists the graph's state, allowing for continuity between separate invocations of the graph.
client = get_client(url="http://localhost:2024"))
new_thread = await client.threads.create(metadata={"user_id": "123"})ThreadsClient(
self,
http: HttpClient,
)| Name | Type |
|---|---|
| http | HttpClient |
Get a thread by ID.
Create a new thread.
Update a thread.
Delete a thread.
Search for threads.
Count threads matching filters.
Copy a thread.
Prune threads by ID.
Get the state of a thread.
Update the state of a thread.
Get the state history of a thread.
Get a stream of events for a thread.