cancel( )
Cancels an ongoing operation.
function cancel(params: infer): PromiseDescription
Cancels an ongoing operation.
Parameters
| Name | Type | Required? | Description |
|---|---|---|---|
params | infer | ✓ | The parameters for the cancellation |
Returns
PromiseExamples
// Cancel inference
await cancel({ operation: "inference", modelId: "model-123" });// Pause download (preserves partial file for automatic resume)
await cancel({ operation: "downloadAsset", downloadKey: "download-key" });// Cancel download completely (deletes partial file)
await cancel({ operation: "downloadAsset", downloadKey: "download-key", clearCache: true });// Cancel RAG operation on default workspace
await cancel({ operation: "rag" });// Cancel RAG operation on specific workspace
await cancel({ operation: "rag", workspace: "my-workspace" });