Get a run.
cancel(
self,
thread_id: str,
run_id: str,
*,
wait: bool = False,
action: CancelAction = 'interrupt',
headers: Mapping[str, str] | None = None,
params: QueryParamTypes | None = None
) -> Noneclient = get_client(url="http://localhost:2024")
await client.runs.cancel(
thread_id="thread_id_to_cancel",
run_id="run_id_to_cancel",
wait=True,
action="interrupt"
)| 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'Action to take when cancelling the run. Possible values
are |
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. |