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

Method list

integrations/openai/src/threads.ts:571–610  ·  view source on GitHub ↗
(
    key: IntegrationTaskKey,
    threadId: string,
    params: Prettify<OpenAI.Beta.AssistantListParams> | OpenAIRequestOptions = {},
    options: OpenAIRequestOptions | undefined = undefined
  )

Source from the content-addressed store, hash-verified

569 options?: OpenAIRequestOptions
570 ): Promise<OpenAI.Beta.Threads.ThreadMessage[]>;
571 async list(
572 key: IntegrationTaskKey,
573 threadId: string,
574 params: Prettify<OpenAI.Beta.AssistantListParams> | OpenAIRequestOptions = {},
575 options: OpenAIRequestOptions | undefined = undefined
576 ): Promise<OpenAI.Beta.Threads.ThreadMessage[]> {
577 return this.runTask(
578 key,
579 async (client, task, io) => {
580 if (isRequestOptions(params)) {
581 const { data: page, response } = await client.beta.threads.messages
582 .list(threadId, {
583 idempotencyKey: task.idempotencyKey,
584 ...params,
585 })
586 .withResponse();
587
588 task.outputProperties = createTaskOutputProperties(undefined, response.headers);
589
590 return page.data;
591 }
592
593 const { data: page, response } = await client.beta.threads.messages
594 .list(threadId, params, {
595 idempotencyKey: task.idempotencyKey,
596 ...options,
597 })
598 .withResponse();
599
600 task.outputProperties = createTaskOutputProperties(undefined, response.headers);
601
602 return page.data;
603 },
604 {
605 name: "List Messages",
606 properties: [{ label: "threadId", text: threadId }],
607 },
608 handleOpenAIError
609 );
610 }
611
612 /**
613 * Returns all messages for a given thread.

Callers

nothing calls this directly

Calls 5

isRequestOptionsFunction · 0.90
withResponseMethod · 0.80
runTaskMethod · 0.45
listMethod · 0.45

Tested by

no test coverage detected