* Returns all runs belonging to a thread.
(
key: IntegrationTaskKey,
threadId: string,
options: OpenAIRequestOptions = {}
)
| 515 | * Returns all runs belonging to a thread. |
| 516 | */ |
| 517 | async list( |
| 518 | key: IntegrationTaskKey, |
| 519 | threadId: string, |
| 520 | options: OpenAIRequestOptions = {} |
| 521 | ): Promise<OpenAI.Beta.Threads.Run[]> { |
| 522 | return this.runTask( |
| 523 | key, |
| 524 | async (client, task, io) => { |
| 525 | const { data: page, response } = await client.beta.threads.runs |
| 526 | .list(threadId, { |
| 527 | idempotencyKey: task.idempotencyKey, |
| 528 | ...options, |
| 529 | }) |
| 530 | .withResponse(); |
| 531 | |
| 532 | const allRuns = []; |
| 533 | |
| 534 | for await (const fineTuningJob of page) { |
| 535 | allRuns.push(fineTuningJob); |
| 536 | } |
| 537 | |
| 538 | task.outputProperties = createTaskOutputProperties(undefined, response.headers); |
| 539 | |
| 540 | return allRuns; |
| 541 | }, |
| 542 | { |
| 543 | name: "List Runs", |
| 544 | properties: [{ label: "threadId", text: threadId }], |
| 545 | }, |
| 546 | handleOpenAIError |
| 547 | ); |
| 548 | } |
| 549 | } |
| 550 | |
| 551 | class Messages { |
no test coverage detected