* Retrieves a thread.
(
key: IntegrationTaskKey,
threadId: string,
options: OpenAIRequestOptions = {}
)
| 162 | * Retrieves a thread. |
| 163 | */ |
| 164 | async retrieve( |
| 165 | key: IntegrationTaskKey, |
| 166 | threadId: string, |
| 167 | options: OpenAIRequestOptions = {} |
| 168 | ): Promise<OpenAI.Beta.Thread> { |
| 169 | return this.runTask( |
| 170 | key, |
| 171 | async (client, task) => { |
| 172 | const { data, response } = await client.beta.threads |
| 173 | .retrieve(threadId, { |
| 174 | idempotencyKey: task.idempotencyKey, |
| 175 | ...options, |
| 176 | }) |
| 177 | .withResponse(); |
| 178 | |
| 179 | task.outputProperties = createTaskOutputProperties(undefined, response.headers); |
| 180 | |
| 181 | return data; |
| 182 | }, |
| 183 | { |
| 184 | name: "Retrieve Thread", |
| 185 | properties: [{ label: "threadId", text: threadId }], |
| 186 | }, |
| 187 | handleOpenAIError |
| 188 | ); |
| 189 | } |
| 190 | |
| 191 | /** |
| 192 | * Modifies a thread. |
nothing calls this directly
no test coverage detected