| Name | Type | Description |
|---|---|---|
thread_id* | str | The thread ID to cancel. |
run_id* | str | The run ID to cancel. |
wait | bool | Default: FalseWhether to wait until run has completed. |
action | CancelAction | Default: 'interrupt' |
headers | Mapping[str, str] | None | Default: None |
params | QueryParamTypes | None | Default: None |
Get a run.
client = get_sync_client(url="http://localhost:2024")
client.runs.cancel(
thread_id="thread_id_to_cancel",
run_id="run_id_to_cancel",
wait=True,
action="interrupt"
)Action to take when cancelling the run. Possible values
are interrupt or rollback. Default is interrupt.
Optional custom headers to include with the request.
Optional query parameters to include with the request.