MCPcopy Index your code
hub / github.com/triggerdotdev/trigger.dev / create

Method create

integrations/openai/src/threads.ts:134–159  ·  view source on GitHub ↗

* Create a thread.

(
    key: IntegrationTaskKey,
    params: Prettify<OpenAI.Beta.ThreadCreateParams> = {},
    options: OpenAIRequestOptions = {}
  )

Source from the content-addressed store, hash-verified

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.

Callers

nothing calls this directly

Calls 4

withResponseMethod · 0.80
createMethod · 0.65
runTaskMethod · 0.45

Tested by

no test coverage detected