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

Method listAll

integrations/openai/src/threads.ts:615–646  ·  view source on GitHub ↗

* Returns all messages for a given thread.

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

Source from the content-addressed store, hash-verified

613 * Returns all messages for a given thread.
614 */
615 async listAll(
616 key: IntegrationTaskKey,
617 threadId: string,
618 options: OpenAIRequestOptions = {}
619 ): Promise<OpenAI.Beta.Threads.ThreadMessage[]> {
620 return this.runTask(
621 key,
622 async (client, task, io) => {
623 const { data: page, response } = await client.beta.threads.messages
624 .list(threadId, {
625 idempotencyKey: task.idempotencyKey,
626 ...options,
627 })
628 .withResponse();
629
630 const allMessages = [];
631
632 for await (const message of page) {
633 allMessages.push(message);
634 }
635
636 task.outputProperties = createTaskOutputProperties(undefined, response.headers);
637
638 return allMessages;
639 },
640 {
641 name: "List All Messages",
642 properties: [{ label: "threadId", text: threadId }],
643 },
644 handleOpenAIError
645 );
646 }
647
648 /**
649 * Create a message.

Callers

nothing calls this directly

Calls 4

withResponseMethod · 0.80
runTaskMethod · 0.45
listMethod · 0.45

Tested by

no test coverage detected