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

Method create

integrations/openai/src/edits.ts:18–61  ·  view source on GitHub ↗

* @deprecated The Edits API is deprecated; please use Chat Completions instead.

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

Source from the content-addressed store, hash-verified

16 * @deprecated The Edits API is deprecated; please use Chat Completions instead.
17 */
18 create(
19 key: IntegrationTaskKey,
20 params: Prettify<OpenAI.EditCreateParams>,
21 options: OpenAIRequestOptions = {}
22 ): Promise<OpenAI.Edit> {
23 let properties = [
24 {
25 label: "Model",
26 text: params.model,
27 },
28 ];
29
30 if (params.input) {
31 properties.push({
32 label: "Input",
33 text: truncate(params.input, 40),
34 });
35 }
36
37 properties.push({
38 label: "Instruction",
39 text: truncate(params.instruction, 40),
40 });
41
42 return this.runTask(
43 key,
44 async (client, task) => {
45 const { data, response } = await client.edits
46 .create(params, {
47 idempotencyKey: task.idempotencyKey,
48 ...options,
49 })
50 .withResponse();
51 task.outputProperties = createTaskOutputProperties(data.usage, response.headers);
52 return data;
53 },
54 {
55 name: "Create edit",
56 params,
57 properties,
58 },
59 handleOpenAIError
60 );
61 }
62}

Callers

nothing calls this directly

Calls 5

truncateFunction · 0.90
withResponseMethod · 0.80
createMethod · 0.65
runTaskMethod · 0.45

Tested by

no test coverage detected