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

Method createFineTune

integrations/openai/src/files.ts:237–267  ·  view source on GitHub ↗
(
    key: IntegrationTaskKey,
    params: CreateFineTuneFileRequest,
    options: OpenAIRequestOptions = {}
  )

Source from the content-addressed store, hash-verified

235 }
236
237 createFineTune(
238 key: IntegrationTaskKey,
239 params: CreateFineTuneFileRequest,
240 options: OpenAIRequestOptions = {}
241 ): Promise<OpenAI.Files.FileObject> {
242 return this.runTask(
243 key,
244 async (client, task) => {
245 const file = await toFile(
246 Buffer.from(params.examples.map((d) => JSON.stringify(d)).join("\n")),
247 params.fileName
248 );
249
250 return client.files.create(
251 { file, purpose: "fine-tune" },
252 { idempotencyKey: task.idempotencyKey, ...options }
253 );
254 },
255 {
256 name: "Create fine tune file",
257 params,
258 properties: [
259 {
260 label: "Examples",
261 text: params.examples.length.toString(),
262 },
263 ],
264 },
265 handleOpenAIError
266 );
267 }
268}

Callers

nothing calls this directly

Calls 4

toFileFunction · 0.85
toStringMethod · 0.80
createMethod · 0.65
runTaskMethod · 0.45

Tested by

no test coverage detected