QVAC Logo

cancel( )

Cancels an ongoing operation.

function cancel(params): Promise<void>;

Parameters

NameTypeRequired?Description
paramsCancelParamsThe parameters for the cancellation

CancelParams

Discriminated union on operation. One of:

Cancel inference

FieldTypeRequired?Description
operation"inference"Operation type
modelIdstringThe model ID to cancel inference for

Cancel download

FieldTypeRequired?DefaultDescription
operation"downloadAsset"Operation type
downloadKeystringThe download key to cancel
clearCachebooleanfalseIf true, deletes the partial download file

Cancel RAG

FieldTypeRequired?DefaultDescription
operation"rag"Operation type
workspacestring"default"The RAG workspace to cancel

Returns

Promise<void> — Resolves when the operation is cancelled.

Throws

ErrorWhen
INVALID_RESPONSE_TYPEResponse type does not match expected "cancel"
CANCEL_FAILEDThe server reports cancellation failure

Examples

// 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" });

On this page