Prune threads by ID.
prune(
self,
thread_ids: Sequence[str],
*,
strategy: PruneStrategy = 'delete',
headers: Mapping[str, str] | None = None,
params: QueryParamTypes | None = None
) -> dict[str, Any]client = get_sync_client(url="http://localhost:2024")
result = client.threads.prune(
thread_ids=["thread_1", "thread_2"],
)
print(result) # {'pruned_count': 2}| Name | Type | Description |
|---|---|---|
thread_ids* | Sequence[str] | List of thread IDs to prune. |
strategy | PruneStrategy | Default: 'delete'The prune strategy. |
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. |