* Retrieve a message.
(
key: IntegrationTaskKey,
threadId: string,
messageId: string,
options: OpenAIRequestOptions = {}
)
| 680 | * Retrieve a message. |
| 681 | */ |
| 682 | async retrieve( |
| 683 | key: IntegrationTaskKey, |
| 684 | threadId: string, |
| 685 | messageId: string, |
| 686 | options: OpenAIRequestOptions = {} |
| 687 | ): Promise<OpenAI.Beta.Threads.ThreadMessage> { |
| 688 | return this.runTask( |
| 689 | key, |
| 690 | async (client, task, io) => { |
| 691 | const { data, response } = await client.beta.threads.messages |
| 692 | .retrieve(threadId, messageId, { |
| 693 | idempotencyKey: task.idempotencyKey, |
| 694 | ...options, |
| 695 | }) |
| 696 | .withResponse(); |
| 697 | |
| 698 | task.outputProperties = createTaskOutputProperties(undefined, response.headers); |
| 699 | |
| 700 | return data; |
| 701 | }, |
| 702 | { |
| 703 | name: "Retrieve Message", |
| 704 | properties: [ |
| 705 | { label: "threadId", text: threadId }, |
| 706 | { label: "messageId", text: messageId }, |
| 707 | ], |
| 708 | }, |
| 709 | handleOpenAIError |
| 710 | ); |
| 711 | } |
| 712 | |
| 713 | /** |
| 714 | * Modifies a message. |
nothing calls this directly
no test coverage detected