Get a thread by ID.
get(
self,
thread_id: str,
*,
include: Sequence[str] | None = None,
headers: Mapping[str, str] | None = None,
params: QueryParamTypes | None = None
) -> Threadclient = get_sync_client(url="http://localhost:2024")
thread = client.threads.get(
thread_id="my_thread_id"
)
print(thread)
-----------------------------------------------------
{
'thread_id': 'my_thread_id',
'created_at': '2024-07-18T18:35:15.540834+00:00',
'updated_at': '2024-07-18T18:35:15.540834+00:00',
'metadata': {'graph_id': 'agent'}
}| Name | Type | Description |
|---|---|---|
thread_id* | str | The ID of the thread to get. |
include | Sequence[str] | None | Default: NoneAdditional fields to include in the response.
Supported values: |
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. |