prune(
self,
thread_ids: Sequence[str],
*,
strategy: PruneStrategy = 'delete'| 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: None |
params | QueryParamTypes | None | Default: None |
Prune threads by ID.
client = get_client(url="http://localhost:2024")
result = await client.threads.prune(
thread_ids=["thread_1", "thread_2"],
)
print(result) # {'pruned_count': 2}Optional custom headers to include with the request.
Optional query parameters to include with the request.