MCPcopy
hub / github.com/triggerdotdev/trigger.dev / create

Method create

integrations/openai/src/assistants.ts:13–56  ·  view source on GitHub ↗
(
    key: IntegrationTaskKey,
    params: Prettify<OpenAI.Beta.AssistantCreateParams>,
    options: OpenAIRequestOptions = {}
  )

Source from the content-addressed store, hash-verified

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,

Callers

nothing calls this directly

Calls 4

withResponseMethod · 0.80
createMethod · 0.65
runTaskMethod · 0.45

Tested by

no test coverage detected