(
key: IntegrationTaskKey,
params: Prettify<OpenAI.Beta.AssistantCreateParams>,
options: OpenAIRequestOptions = {}
)
| 11 | ) { } |
| 12 | |
| 13 | async create( |
| 14 | key: IntegrationTaskKey, |
| 15 | params: Prettify<OpenAI.Beta.AssistantCreateParams>, |
| 16 | options: OpenAIRequestOptions = {} |
| 17 | ): Promise<OpenAI.Beta.Assistant> { |
| 18 | return this.runTask( |
| 19 | key, |
| 20 | async (client, task) => { |
| 21 | const { data, response } = await client.beta.assistants |
| 22 | .create(params, { |
| 23 | idempotencyKey: task.idempotencyKey, |
| 24 | ...options, |
| 25 | }) |
| 26 | .withResponse(); |
| 27 | |
| 28 | const outputProperties = createTaskOutputProperties(undefined, response.headers); |
| 29 | |
| 30 | task.outputProperties = [ |
| 31 | ...(outputProperties ?? []), |
| 32 | { |
| 33 | label: "assistantId", |
| 34 | text: data.id, |
| 35 | }, |
| 36 | ]; |
| 37 | |
| 38 | return data; |
| 39 | }, |
| 40 | { |
| 41 | name: "Create Assistant", |
| 42 | params, |
| 43 | properties: [ |
| 44 | { |
| 45 | label: "model", |
| 46 | text: params.model, |
| 47 | }, |
| 48 | ...(params.name ? [{ label: "name", text: params.name }] : []), |
| 49 | ...(params.file_ids && params.file_ids.length > 0 |
| 50 | ? [{ label: "files", text: params.file_ids.join(", ") }] |
| 51 | : []), |
| 52 | ], |
| 53 | }, |
| 54 | handleOpenAIError |
| 55 | ); |
| 56 | } |
| 57 | |
| 58 | async update( |
| 59 | key: IntegrationTaskKey, |
nothing calls this directly
no test coverage detected