@ai-sdk/openai 2.0.0-canary.12 → 2.0.0-canary.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -254,7 +254,13 @@ var openaiProviderOptions = z.object({
254
254
  /**
255
255
  * Parameters for prediction mode.
256
256
  */
257
- prediction: z.record(z.any()).optional()
257
+ prediction: z.record(z.any()).optional(),
258
+ /**
259
+ * Whether to use structured outputs.
260
+ *
261
+ * @default true
262
+ */
263
+ structuredOutputs: z.boolean().optional()
258
264
  });
259
265
 
260
266
  // src/openai-error.ts
@@ -337,10 +343,9 @@ function prepareTools({
337
343
 
338
344
  // src/openai-chat-language-model.ts
339
345
  var OpenAIChatLanguageModel = class {
340
- constructor(modelId, settings, config) {
346
+ constructor(modelId, config) {
341
347
  this.specificationVersion = "v2";
342
348
  this.modelId = modelId;
343
- this.settings = settings;
344
349
  this.config = config;
345
350
  }
346
351
  get provider() {
@@ -373,13 +378,14 @@ var OpenAIChatLanguageModel = class {
373
378
  providerOptions,
374
379
  schema: openaiProviderOptions
375
380
  })) != null ? _a : {};
381
+ const structuredOutputs = (_b = openaiOptions.structuredOutputs) != null ? _b : true;
376
382
  if (topK != null) {
377
383
  warnings.push({
378
384
  type: "unsupported-setting",
379
385
  setting: "topK"
380
386
  });
381
387
  }
382
- if ((responseFormat == null ? void 0 : responseFormat.type) === "json" && responseFormat.schema != null && !this.settings.structuredOutputs) {
388
+ if ((responseFormat == null ? void 0 : responseFormat.type) === "json" && responseFormat.schema != null && !structuredOutputs) {
383
389
  warnings.push({
384
390
  type: "unsupported-setting",
385
391
  setting: "responseFormat",
@@ -408,12 +414,12 @@ var OpenAIChatLanguageModel = class {
408
414
  presence_penalty: presencePenalty,
409
415
  response_format: (responseFormat == null ? void 0 : responseFormat.type) === "json" ? (
410
416
  // TODO convert into provider option
411
- this.settings.structuredOutputs && responseFormat.schema != null ? {
417
+ structuredOutputs && responseFormat.schema != null ? {
412
418
  type: "json_schema",
413
419
  json_schema: {
414
420
  schema: responseFormat.schema,
415
421
  strict: true,
416
- name: (_b = responseFormat.name) != null ? _b : "response",
422
+ name: (_c = responseFormat.name) != null ? _c : "response",
417
423
  description: responseFormat.description
418
424
  }
419
425
  } : { type: "json_object" }
@@ -493,7 +499,7 @@ var OpenAIChatLanguageModel = class {
493
499
  } = prepareTools({
494
500
  tools,
495
501
  toolChoice,
496
- structuredOutputs: (_c = this.settings.structuredOutputs) != null ? _c : false
502
+ structuredOutputs
497
503
  });
498
504
  return {
499
505
  args: {
@@ -878,13 +884,9 @@ import {
878
884
  } from "@ai-sdk/provider";
879
885
  function convertToOpenAICompletionPrompt({
880
886
  prompt,
881
- inputFormat,
882
887
  user = "user",
883
888
  assistant = "assistant"
884
889
  }) {
885
- if (inputFormat === "prompt" && prompt.length === 1 && prompt[0].role === "user" && prompt[0].content.length === 1 && prompt[0].content[0].type === "text") {
886
- return { prompt: prompt[0].content[0].text };
887
- }
888
890
  let text = "";
889
891
  if (prompt[0].role === "system") {
890
892
  text += `${prompt[0].content}
@@ -1005,7 +1007,6 @@ var OpenAICompletionLanguageModel = class {
1005
1007
  };
1006
1008
  }
1007
1009
  async getArgs({
1008
- inputFormat,
1009
1010
  prompt,
1010
1011
  maxOutputTokens,
1011
1012
  temperature,
@@ -1049,7 +1050,7 @@ var OpenAICompletionLanguageModel = class {
1049
1050
  details: "JSON response format is not supported."
1050
1051
  });
1051
1052
  }
1052
- const { prompt: completionPrompt, stopSequences } = convertToOpenAICompletionPrompt({ prompt, inputFormat });
1053
+ const { prompt: completionPrompt, stopSequences } = convertToOpenAICompletionPrompt({ prompt });
1053
1054
  const stop = [...stopSequences != null ? stopSequences : [], ...userStopSequences != null ? userStopSequences : []];
1054
1055
  return {
1055
1056
  args: {
@@ -1258,23 +1259,16 @@ var openaiEmbeddingProviderOptions = z6.object({
1258
1259
 
1259
1260
  // src/openai-embedding-model.ts
1260
1261
  var OpenAIEmbeddingModel = class {
1261
- constructor(modelId, settings, config) {
1262
+ constructor(modelId, config) {
1262
1263
  this.specificationVersion = "v2";
1264
+ this.maxEmbeddingsPerCall = 2048;
1265
+ this.supportsParallelCalls = true;
1263
1266
  this.modelId = modelId;
1264
- this.settings = settings;
1265
1267
  this.config = config;
1266
1268
  }
1267
1269
  get provider() {
1268
1270
  return this.config.provider;
1269
1271
  }
1270
- get maxEmbeddingsPerCall() {
1271
- var _a;
1272
- return (_a = this.settings.maxEmbeddingsPerCall) != null ? _a : 2048;
1273
- }
1274
- get supportsParallelCalls() {
1275
- var _a;
1276
- return (_a = this.settings.supportsParallelCalls) != null ? _a : true;
1277
- }
1278
1272
  async doEmbed({
1279
1273
  values,
1280
1274
  headers,
@@ -1450,14 +1444,36 @@ import {
1450
1444
  parseProviderOptions as parseProviderOptions4,
1451
1445
  postFormDataToApi
1452
1446
  } from "@ai-sdk/provider-utils";
1447
+ import { z as z11 } from "zod";
1448
+
1449
+ // src/openai-transcription-options.ts
1453
1450
  import { z as z10 } from "zod";
1454
- var openAIProviderOptionsSchema = z10.object({
1451
+ var openAITranscriptionProviderOptions = z10.object({
1452
+ /**
1453
+ * Additional information to include in the transcription response.
1454
+ */
1455
1455
  include: z10.array(z10.string()).nullish(),
1456
+ /**
1457
+ * The language of the input audio in ISO-639-1 format.
1458
+ */
1456
1459
  language: z10.string().nullish(),
1460
+ /**
1461
+ * An optional text to guide the model's style or continue a previous audio segment.
1462
+ */
1457
1463
  prompt: z10.string().nullish(),
1458
- temperature: z10.number().min(0).max(1).nullish().default(0),
1459
- timestampGranularities: z10.array(z10.enum(["word", "segment"])).nullish().default(["segment"])
1464
+ /**
1465
+ * The sampling temperature, between 0 and 1.
1466
+ * @default 0
1467
+ */
1468
+ temperature: z10.number().min(0).max(1).default(0).nullish(),
1469
+ /**
1470
+ * The timestamp granularities to populate for this transcription.
1471
+ * @default ['segment']
1472
+ */
1473
+ timestampGranularities: z10.array(z10.enum(["word", "segment"])).default(["segment"]).nullish()
1460
1474
  });
1475
+
1476
+ // src/openai-transcription-model.ts
1461
1477
  var languageMap = {
1462
1478
  afrikaans: "af",
1463
1479
  arabic: "ar",
@@ -1531,12 +1547,11 @@ var OpenAITranscriptionModel = class {
1531
1547
  mediaType,
1532
1548
  providerOptions
1533
1549
  }) {
1534
- var _a, _b, _c, _d, _e;
1535
1550
  const warnings = [];
1536
1551
  const openAIOptions = await parseProviderOptions4({
1537
1552
  provider: "openai",
1538
1553
  providerOptions,
1539
- schema: openAIProviderOptionsSchema
1554
+ schema: openAITranscriptionProviderOptions
1540
1555
  });
1541
1556
  const formData = new FormData();
1542
1557
  const blob = audio instanceof Uint8Array ? new Blob([audio]) : new Blob([convertBase64ToUint8Array(audio)]);
@@ -1544,15 +1559,14 @@ var OpenAITranscriptionModel = class {
1544
1559
  formData.append("file", new File([blob], "audio", { type: mediaType }));
1545
1560
  if (openAIOptions) {
1546
1561
  const transcriptionModelOptions = {
1547
- include: (_a = openAIOptions.include) != null ? _a : void 0,
1548
- language: (_b = openAIOptions.language) != null ? _b : void 0,
1549
- prompt: (_c = openAIOptions.prompt) != null ? _c : void 0,
1550
- temperature: (_d = openAIOptions.temperature) != null ? _d : void 0,
1551
- timestamp_granularities: (_e = openAIOptions.timestampGranularities) != null ? _e : void 0
1562
+ include: openAIOptions.include,
1563
+ language: openAIOptions.language,
1564
+ prompt: openAIOptions.prompt,
1565
+ temperature: openAIOptions.temperature,
1566
+ timestamp_granularities: openAIOptions.timestampGranularities
1552
1567
  };
1553
- for (const key in transcriptionModelOptions) {
1554
- const value = transcriptionModelOptions[key];
1555
- if (value !== void 0) {
1568
+ for (const [key, value] of Object.entries(transcriptionModelOptions)) {
1569
+ if (value != null) {
1556
1570
  formData.append(key, String(value));
1557
1571
  }
1558
1572
  }
@@ -1604,15 +1618,15 @@ var OpenAITranscriptionModel = class {
1604
1618
  };
1605
1619
  }
1606
1620
  };
1607
- var openaiTranscriptionResponseSchema = z10.object({
1608
- text: z10.string(),
1609
- language: z10.string().nullish(),
1610
- duration: z10.number().nullish(),
1611
- words: z10.array(
1612
- z10.object({
1613
- word: z10.string(),
1614
- start: z10.number(),
1615
- end: z10.number()
1621
+ var openaiTranscriptionResponseSchema = z11.object({
1622
+ text: z11.string(),
1623
+ language: z11.string().nullish(),
1624
+ duration: z11.number().nullish(),
1625
+ words: z11.array(
1626
+ z11.object({
1627
+ word: z11.string(),
1628
+ start: z11.number(),
1629
+ end: z11.number()
1616
1630
  })
1617
1631
  ).nullish()
1618
1632
  });
@@ -1626,7 +1640,7 @@ import {
1626
1640
  parseProviderOptions as parseProviderOptions5,
1627
1641
  postJsonToApi as postJsonToApi5
1628
1642
  } from "@ai-sdk/provider-utils";
1629
- import { z as z11 } from "zod";
1643
+ import { z as z12 } from "zod";
1630
1644
 
1631
1645
  // src/responses/convert-to-openai-responses-messages.ts
1632
1646
  import {
@@ -1991,55 +2005,55 @@ var OpenAIResponsesLanguageModel = class {
1991
2005
  body,
1992
2006
  failedResponseHandler: openaiFailedResponseHandler,
1993
2007
  successfulResponseHandler: createJsonResponseHandler6(
1994
- z11.object({
1995
- id: z11.string(),
1996
- created_at: z11.number(),
1997
- model: z11.string(),
1998
- output: z11.array(
1999
- z11.discriminatedUnion("type", [
2000
- z11.object({
2001
- type: z11.literal("message"),
2002
- role: z11.literal("assistant"),
2003
- content: z11.array(
2004
- z11.object({
2005
- type: z11.literal("output_text"),
2006
- text: z11.string(),
2007
- annotations: z11.array(
2008
- z11.object({
2009
- type: z11.literal("url_citation"),
2010
- start_index: z11.number(),
2011
- end_index: z11.number(),
2012
- url: z11.string(),
2013
- title: z11.string()
2008
+ z12.object({
2009
+ id: z12.string(),
2010
+ created_at: z12.number(),
2011
+ model: z12.string(),
2012
+ output: z12.array(
2013
+ z12.discriminatedUnion("type", [
2014
+ z12.object({
2015
+ type: z12.literal("message"),
2016
+ role: z12.literal("assistant"),
2017
+ content: z12.array(
2018
+ z12.object({
2019
+ type: z12.literal("output_text"),
2020
+ text: z12.string(),
2021
+ annotations: z12.array(
2022
+ z12.object({
2023
+ type: z12.literal("url_citation"),
2024
+ start_index: z12.number(),
2025
+ end_index: z12.number(),
2026
+ url: z12.string(),
2027
+ title: z12.string()
2014
2028
  })
2015
2029
  )
2016
2030
  })
2017
2031
  )
2018
2032
  }),
2019
- z11.object({
2020
- type: z11.literal("function_call"),
2021
- call_id: z11.string(),
2022
- name: z11.string(),
2023
- arguments: z11.string()
2033
+ z12.object({
2034
+ type: z12.literal("function_call"),
2035
+ call_id: z12.string(),
2036
+ name: z12.string(),
2037
+ arguments: z12.string()
2024
2038
  }),
2025
- z11.object({
2026
- type: z11.literal("web_search_call")
2039
+ z12.object({
2040
+ type: z12.literal("web_search_call")
2027
2041
  }),
2028
- z11.object({
2029
- type: z11.literal("computer_call")
2042
+ z12.object({
2043
+ type: z12.literal("computer_call")
2030
2044
  }),
2031
- z11.object({
2032
- type: z11.literal("reasoning"),
2033
- summary: z11.array(
2034
- z11.object({
2035
- type: z11.literal("summary_text"),
2036
- text: z11.string()
2045
+ z12.object({
2046
+ type: z12.literal("reasoning"),
2047
+ summary: z12.array(
2048
+ z12.object({
2049
+ type: z12.literal("summary_text"),
2050
+ text: z12.string()
2037
2051
  })
2038
2052
  )
2039
2053
  })
2040
2054
  ])
2041
2055
  ),
2042
- incomplete_details: z11.object({ reason: z11.string() }).nullable(),
2056
+ incomplete_details: z12.object({ reason: z12.string() }).nullable(),
2043
2057
  usage: usageSchema
2044
2058
  })
2045
2059
  ),
@@ -2253,86 +2267,86 @@ var OpenAIResponsesLanguageModel = class {
2253
2267
  };
2254
2268
  }
2255
2269
  };
2256
- var usageSchema = z11.object({
2257
- input_tokens: z11.number(),
2258
- input_tokens_details: z11.object({ cached_tokens: z11.number().nullish() }).nullish(),
2259
- output_tokens: z11.number(),
2260
- output_tokens_details: z11.object({ reasoning_tokens: z11.number().nullish() }).nullish()
2270
+ var usageSchema = z12.object({
2271
+ input_tokens: z12.number(),
2272
+ input_tokens_details: z12.object({ cached_tokens: z12.number().nullish() }).nullish(),
2273
+ output_tokens: z12.number(),
2274
+ output_tokens_details: z12.object({ reasoning_tokens: z12.number().nullish() }).nullish()
2261
2275
  });
2262
- var textDeltaChunkSchema = z11.object({
2263
- type: z11.literal("response.output_text.delta"),
2264
- delta: z11.string()
2276
+ var textDeltaChunkSchema = z12.object({
2277
+ type: z12.literal("response.output_text.delta"),
2278
+ delta: z12.string()
2265
2279
  });
2266
- var responseFinishedChunkSchema = z11.object({
2267
- type: z11.enum(["response.completed", "response.incomplete"]),
2268
- response: z11.object({
2269
- incomplete_details: z11.object({ reason: z11.string() }).nullish(),
2280
+ var responseFinishedChunkSchema = z12.object({
2281
+ type: z12.enum(["response.completed", "response.incomplete"]),
2282
+ response: z12.object({
2283
+ incomplete_details: z12.object({ reason: z12.string() }).nullish(),
2270
2284
  usage: usageSchema
2271
2285
  })
2272
2286
  });
2273
- var responseCreatedChunkSchema = z11.object({
2274
- type: z11.literal("response.created"),
2275
- response: z11.object({
2276
- id: z11.string(),
2277
- created_at: z11.number(),
2278
- model: z11.string()
2287
+ var responseCreatedChunkSchema = z12.object({
2288
+ type: z12.literal("response.created"),
2289
+ response: z12.object({
2290
+ id: z12.string(),
2291
+ created_at: z12.number(),
2292
+ model: z12.string()
2279
2293
  })
2280
2294
  });
2281
- var responseOutputItemDoneSchema = z11.object({
2282
- type: z11.literal("response.output_item.done"),
2283
- output_index: z11.number(),
2284
- item: z11.discriminatedUnion("type", [
2285
- z11.object({
2286
- type: z11.literal("message")
2295
+ var responseOutputItemDoneSchema = z12.object({
2296
+ type: z12.literal("response.output_item.done"),
2297
+ output_index: z12.number(),
2298
+ item: z12.discriminatedUnion("type", [
2299
+ z12.object({
2300
+ type: z12.literal("message")
2287
2301
  }),
2288
- z11.object({
2289
- type: z11.literal("function_call"),
2290
- id: z11.string(),
2291
- call_id: z11.string(),
2292
- name: z11.string(),
2293
- arguments: z11.string(),
2294
- status: z11.literal("completed")
2302
+ z12.object({
2303
+ type: z12.literal("function_call"),
2304
+ id: z12.string(),
2305
+ call_id: z12.string(),
2306
+ name: z12.string(),
2307
+ arguments: z12.string(),
2308
+ status: z12.literal("completed")
2295
2309
  })
2296
2310
  ])
2297
2311
  });
2298
- var responseFunctionCallArgumentsDeltaSchema = z11.object({
2299
- type: z11.literal("response.function_call_arguments.delta"),
2300
- item_id: z11.string(),
2301
- output_index: z11.number(),
2302
- delta: z11.string()
2312
+ var responseFunctionCallArgumentsDeltaSchema = z12.object({
2313
+ type: z12.literal("response.function_call_arguments.delta"),
2314
+ item_id: z12.string(),
2315
+ output_index: z12.number(),
2316
+ delta: z12.string()
2303
2317
  });
2304
- var responseOutputItemAddedSchema = z11.object({
2305
- type: z11.literal("response.output_item.added"),
2306
- output_index: z11.number(),
2307
- item: z11.discriminatedUnion("type", [
2308
- z11.object({
2309
- type: z11.literal("message")
2318
+ var responseOutputItemAddedSchema = z12.object({
2319
+ type: z12.literal("response.output_item.added"),
2320
+ output_index: z12.number(),
2321
+ item: z12.discriminatedUnion("type", [
2322
+ z12.object({
2323
+ type: z12.literal("message")
2310
2324
  }),
2311
- z11.object({
2312
- type: z11.literal("function_call"),
2313
- id: z11.string(),
2314
- call_id: z11.string(),
2315
- name: z11.string(),
2316
- arguments: z11.string()
2325
+ z12.object({
2326
+ type: z12.literal("function_call"),
2327
+ id: z12.string(),
2328
+ call_id: z12.string(),
2329
+ name: z12.string(),
2330
+ arguments: z12.string()
2317
2331
  })
2318
2332
  ])
2319
2333
  });
2320
- var responseAnnotationAddedSchema = z11.object({
2321
- type: z11.literal("response.output_text.annotation.added"),
2322
- annotation: z11.object({
2323
- type: z11.literal("url_citation"),
2324
- url: z11.string(),
2325
- title: z11.string()
2334
+ var responseAnnotationAddedSchema = z12.object({
2335
+ type: z12.literal("response.output_text.annotation.added"),
2336
+ annotation: z12.object({
2337
+ type: z12.literal("url_citation"),
2338
+ url: z12.string(),
2339
+ title: z12.string()
2326
2340
  })
2327
2341
  });
2328
- var responseReasoningSummaryTextDeltaSchema = z11.object({
2329
- type: z11.literal("response.reasoning_summary_text.delta"),
2330
- item_id: z11.string(),
2331
- output_index: z11.number(),
2332
- summary_index: z11.number(),
2333
- delta: z11.string()
2342
+ var responseReasoningSummaryTextDeltaSchema = z12.object({
2343
+ type: z12.literal("response.reasoning_summary_text.delta"),
2344
+ item_id: z12.string(),
2345
+ output_index: z12.number(),
2346
+ summary_index: z12.number(),
2347
+ delta: z12.string()
2334
2348
  });
2335
- var openaiResponsesChunkSchema = z11.union([
2349
+ var openaiResponsesChunkSchema = z12.union([
2336
2350
  textDeltaChunkSchema,
2337
2351
  responseFinishedChunkSchema,
2338
2352
  responseCreatedChunkSchema,
@@ -2341,7 +2355,7 @@ var openaiResponsesChunkSchema = z11.union([
2341
2355
  responseOutputItemAddedSchema,
2342
2356
  responseAnnotationAddedSchema,
2343
2357
  responseReasoningSummaryTextDeltaSchema,
2344
- z11.object({ type: z11.string() }).passthrough()
2358
+ z12.object({ type: z12.string() }).passthrough()
2345
2359
  // fallback for unknown chunks
2346
2360
  ]);
2347
2361
  function isTextDeltaChunk(chunk) {
@@ -2389,16 +2403,16 @@ function getResponsesModelConfig(modelId) {
2389
2403
  requiredAutoTruncation: false
2390
2404
  };
2391
2405
  }
2392
- var openaiResponsesProviderOptionsSchema = z11.object({
2393
- metadata: z11.any().nullish(),
2394
- parallelToolCalls: z11.boolean().nullish(),
2395
- previousResponseId: z11.string().nullish(),
2396
- store: z11.boolean().nullish(),
2397
- user: z11.string().nullish(),
2398
- reasoningEffort: z11.string().nullish(),
2399
- strictSchemas: z11.boolean().nullish(),
2400
- instructions: z11.string().nullish(),
2401
- reasoningSummary: z11.string().nullish()
2406
+ var openaiResponsesProviderOptionsSchema = z12.object({
2407
+ metadata: z12.any().nullish(),
2408
+ parallelToolCalls: z12.boolean().nullish(),
2409
+ previousResponseId: z12.string().nullish(),
2410
+ store: z12.boolean().nullish(),
2411
+ user: z12.string().nullish(),
2412
+ reasoningEffort: z12.string().nullish(),
2413
+ strictSchemas: z12.boolean().nullish(),
2414
+ instructions: z12.string().nullish(),
2415
+ reasoningSummary: z12.string().nullish()
2402
2416
  });
2403
2417
 
2404
2418
  // src/openai-speech-model.ts
@@ -2408,10 +2422,10 @@ import {
2408
2422
  parseProviderOptions as parseProviderOptions6,
2409
2423
  postJsonToApi as postJsonToApi6
2410
2424
  } from "@ai-sdk/provider-utils";
2411
- import { z as z12 } from "zod";
2412
- var OpenAIProviderOptionsSchema = z12.object({
2413
- instructions: z12.string().nullish(),
2414
- speed: z12.number().min(0.25).max(4).default(1).nullish()
2425
+ import { z as z13 } from "zod";
2426
+ var OpenAIProviderOptionsSchema = z13.object({
2427
+ instructions: z13.string().nullish(),
2428
+ speed: z13.number().min(0.25).max(4).default(1).nullish()
2415
2429
  });
2416
2430
  var OpenAISpeechModel = class {
2417
2431
  constructor(modelId, config) {
@@ -2521,7 +2535,7 @@ function createOpenAI(options = {}) {
2521
2535
  "OpenAI-Project": options.project,
2522
2536
  ...options.headers
2523
2537
  });
2524
- const createChatModel = (modelId, settings = {}) => new OpenAIChatLanguageModel(modelId, settings, {
2538
+ const createChatModel = (modelId) => new OpenAIChatLanguageModel(modelId, {
2525
2539
  provider: `${providerName}.chat`,
2526
2540
  url: ({ path }) => `${baseURL}${path}`,
2527
2541
  headers: getHeaders,
@@ -2535,7 +2549,7 @@ function createOpenAI(options = {}) {
2535
2549
  compatibility,
2536
2550
  fetch: options.fetch
2537
2551
  });
2538
- const createEmbeddingModel = (modelId, settings = {}) => new OpenAIEmbeddingModel(modelId, settings, {
2552
+ const createEmbeddingModel = (modelId) => new OpenAIEmbeddingModel(modelId, {
2539
2553
  provider: `${providerName}.embedding`,
2540
2554
  url: ({ path }) => `${baseURL}${path}`,
2541
2555
  headers: getHeaders,
@@ -2559,7 +2573,7 @@ function createOpenAI(options = {}) {
2559
2573
  headers: getHeaders,
2560
2574
  fetch: options.fetch
2561
2575
  });
2562
- const createLanguageModel = (modelId, settings) => {
2576
+ const createLanguageModel = (modelId) => {
2563
2577
  if (new.target) {
2564
2578
  throw new Error(
2565
2579
  "The OpenAI model function cannot be called with the new keyword."
@@ -2568,7 +2582,7 @@ function createOpenAI(options = {}) {
2568
2582
  if (modelId === "gpt-3.5-turbo-instruct") {
2569
2583
  return createCompletionModel(modelId);
2570
2584
  }
2571
- return createChatModel(modelId, settings);
2585
+ return createChatModel(modelId);
2572
2586
  };
2573
2587
  const createResponsesModel = (modelId) => {
2574
2588
  return new OpenAIResponsesLanguageModel(modelId, {
@@ -2578,8 +2592,8 @@ function createOpenAI(options = {}) {
2578
2592
  fetch: options.fetch
2579
2593
  });
2580
2594
  };
2581
- const provider = function(modelId, settings) {
2582
- return createLanguageModel(modelId, settings);
2595
+ const provider = function(modelId) {
2596
+ return createLanguageModel(modelId);
2583
2597
  };
2584
2598
  provider.languageModel = createLanguageModel;
2585
2599
  provider.chat = createChatModel;