* Modifies a thread.
(
key: IntegrationTaskKey,
threadId: string,
body: ThreadUpdateParams,
options: OpenAIRequestOptions = {}
)
| 192 | * Modifies a thread. |
| 193 | */ |
| 194 | async update( |
| 195 | key: IntegrationTaskKey, |
| 196 | threadId: string, |
| 197 | body: ThreadUpdateParams, |
| 198 | options: OpenAIRequestOptions = {} |
| 199 | ): Promise<OpenAI.Beta.Thread> { |
| 200 | return this.runTask( |
| 201 | key, |
| 202 | async (client, task) => { |
| 203 | const { data, response } = await client.beta.threads |
| 204 | .update(threadId, body, { |
| 205 | idempotencyKey: task.idempotencyKey, |
| 206 | ...options, |
| 207 | }) |
| 208 | .withResponse(); |
| 209 | |
| 210 | task.outputProperties = createTaskOutputProperties(undefined, response.headers); |
| 211 | |
| 212 | return data; |
| 213 | }, |
| 214 | { |
| 215 | name: "Update Thread", |
| 216 | properties: [{ label: "threadId", text: threadId }], |
| 217 | }, |
| 218 | handleOpenAIError |
| 219 | ); |
| 220 | } |
| 221 | |
| 222 | /** |
| 223 | * Delete a thread. |