MCPcopy Index your code
hub / github.com/triggerdotdev/trigger.dev / cancel

Method cancel

integrations/openai/src/threads.ts:445–474  ·  view source on GitHub ↗

* Cancels a run that is `in_progress`.

(
    key: IntegrationTaskKey,
    threadId: string,
    runId: string,
    options: OpenAIRequestOptions = {}
  )

Source from the content-addressed store, hash-verified

443 * Cancels a run that is `in_progress`.
444 */
445 async cancel(
446 key: IntegrationTaskKey,
447 threadId: string,
448 runId: string,
449 options: OpenAIRequestOptions = {}
450 ): Promise<OpenAI.Beta.Threads.Run> {
451 return this.runTask(
452 key,
453 async (client, task, io) => {
454 const { data, response } = await client.beta.threads.runs
455 .cancel(threadId, runId, {
456 idempotencyKey: task.idempotencyKey,
457 ...options,
458 })
459 .withResponse();
460
461 task.outputProperties = createTaskOutputProperties(undefined, response.headers);
462
463 return data;
464 },
465 {
466 name: "Cancel Run",
467 properties: [
468 { label: "threadId", text: threadId },
469 { label: "runId", text: runId },
470 ],
471 },
472 handleOpenAIError
473 );
474 }
475
476 /**
477 * When a run has the `status: "requires_action"` and `required_action.type` is

Callers 1

doRunsFunction · 0.45

Calls 3

withResponseMethod · 0.80
runTaskMethod · 0.45

Tested by

no test coverage detected