* Create a thread.
(
key: IntegrationTaskKey,
params: Prettify<OpenAI.Beta.ThreadCreateParams> = {},
options: OpenAIRequestOptions = {}
)
| 132 | * Create a thread. |
| 133 | */ |
| 134 | async create( |
| 135 | key: IntegrationTaskKey, |
| 136 | params: Prettify<OpenAI.Beta.ThreadCreateParams> = {}, |
| 137 | options: OpenAIRequestOptions = {} |
| 138 | ): Promise<OpenAI.Beta.Thread> { |
| 139 | return this.runTask( |
| 140 | key, |
| 141 | async (client, task) => { |
| 142 | const { data, response } = await client.beta.threads |
| 143 | .create(params, { |
| 144 | idempotencyKey: task.idempotencyKey, |
| 145 | ...options, |
| 146 | }) |
| 147 | .withResponse(); |
| 148 | |
| 149 | task.outputProperties = createTaskOutputProperties(undefined, response.headers); |
| 150 | |
| 151 | return data; |
| 152 | }, |
| 153 | { |
| 154 | name: "Create Thread", |
| 155 | params, |
| 156 | }, |
| 157 | handleOpenAIError |
| 158 | ); |
| 159 | } |
| 160 | |
| 161 | /** |
| 162 | * Retrieves a thread. |
nothing calls this directly
no test coverage detected