* Delete a thread.
(
key: IntegrationTaskKey,
threadId: string,
options: OpenAIRequestOptions = {}
)
| 223 | * Delete a thread. |
| 224 | */ |
| 225 | async del( |
| 226 | key: IntegrationTaskKey, |
| 227 | threadId: string, |
| 228 | options: OpenAIRequestOptions = {} |
| 229 | ): Promise<OpenAI.Beta.ThreadDeleted> { |
| 230 | return this.runTask( |
| 231 | key, |
| 232 | async (client, task) => { |
| 233 | const { data, response } = await client.beta.threads |
| 234 | .del(threadId, { |
| 235 | idempotencyKey: task.idempotencyKey, |
| 236 | ...options, |
| 237 | }) |
| 238 | .withResponse(); |
| 239 | |
| 240 | task.outputProperties = createTaskOutputProperties(undefined, response.headers); |
| 241 | |
| 242 | return data; |
| 243 | }, |
| 244 | { |
| 245 | name: "Delete Thread", |
| 246 | properties: [{ label: "threadId", text: threadId }], |
| 247 | }, |
| 248 | handleOpenAIError |
| 249 | ); |
| 250 | } |
| 251 | |
| 252 | get runs() { |
| 253 | return new Runs(this.runTask.bind(this), this.options); |
no test coverage detected