@ai-sdk/openai 3.0.0-beta.78 → 3.0.0-beta.80

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/CHANGELOG.md CHANGED
@@ -1,5 +1,20 @@
1
1
  # @ai-sdk/openai
2
2
 
3
+ ## 3.0.0-beta.80
4
+
5
+ ### Patch Changes
6
+
7
+ - b60d2e2: fix(openai): allow open_page action type url to be nullish
8
+
9
+ ## 3.0.0-beta.79
10
+
11
+ ### Patch Changes
12
+
13
+ - 1bd7d32: feat: tool-specific strict mode
14
+ - Updated dependencies [1bd7d32]
15
+ - @ai-sdk/provider-utils@4.0.0-beta.41
16
+ - @ai-sdk/provider@3.0.0-beta.23
17
+
3
18
  ## 3.0.0-beta.78
4
19
 
5
20
  ### Patch Changes
package/dist/index.d.mts CHANGED
@@ -51,7 +51,7 @@ declare const webSearchToolFactory: _ai_sdk_provider_utils.ProviderToolFactoryWi
51
51
  /**
52
52
  * The URL opened by the model.
53
53
  */
54
- url: string;
54
+ url?: string | null;
55
55
  } | {
56
56
  /**
57
57
  * Action type "find": Searches for a pattern within a loaded page.
@@ -60,11 +60,11 @@ declare const webSearchToolFactory: _ai_sdk_provider_utils.ProviderToolFactoryWi
60
60
  /**
61
61
  * The URL of the page searched for the pattern.
62
62
  */
63
- url: string;
63
+ url?: string | null;
64
64
  /**
65
65
  * The pattern or text to search for within the page.
66
66
  */
67
- pattern: string;
67
+ pattern?: string | null;
68
68
  };
69
69
  /**
70
70
  * Optional sources cited by the model for the web search call.
@@ -320,11 +320,11 @@ declare const openaiTools: {
320
320
  query?: string;
321
321
  } | {
322
322
  type: "openPage";
323
- url: string;
323
+ url?: string | null;
324
324
  } | {
325
325
  type: "find";
326
- url: string;
327
- pattern: string;
326
+ url?: string | null;
327
+ pattern?: string | null;
328
328
  };
329
329
  }, {
330
330
  searchContextSize?: "low" | "medium" | "high";
@@ -333,16 +333,7 @@ declare const openaiTools: {
333
333
  country?: string;
334
334
  city?: string;
335
335
  region?: string;
336
- timezone
337
- /**
338
- * Web search allows models to access up-to-date information from the internet
339
- * and provide answers with sourced citations.
340
- *
341
- * @param filters - The filters to use for the web search.
342
- * @param searchContextSize - The search context size to use for the web search.
343
- * @param userLocation - The user location to use for the web search.
344
- */
345
- ?: string;
336
+ timezone?: string;
346
337
  };
347
338
  }>;
348
339
  /**
@@ -359,11 +350,11 @@ declare const openaiTools: {
359
350
  query?: string;
360
351
  } | {
361
352
  type: "openPage";
362
- url: string;
353
+ url?: string | null;
363
354
  } | {
364
355
  type: "find";
365
- url: string;
366
- pattern: string;
356
+ url?: string | null;
357
+ pattern?: string | null;
367
358
  };
368
359
  sources?: Array<{
369
360
  type: "url";
package/dist/index.d.ts CHANGED
@@ -51,7 +51,7 @@ declare const webSearchToolFactory: _ai_sdk_provider_utils.ProviderToolFactoryWi
51
51
  /**
52
52
  * The URL opened by the model.
53
53
  */
54
- url: string;
54
+ url?: string | null;
55
55
  } | {
56
56
  /**
57
57
  * Action type "find": Searches for a pattern within a loaded page.
@@ -60,11 +60,11 @@ declare const webSearchToolFactory: _ai_sdk_provider_utils.ProviderToolFactoryWi
60
60
  /**
61
61
  * The URL of the page searched for the pattern.
62
62
  */
63
- url: string;
63
+ url?: string | null;
64
64
  /**
65
65
  * The pattern or text to search for within the page.
66
66
  */
67
- pattern: string;
67
+ pattern?: string | null;
68
68
  };
69
69
  /**
70
70
  * Optional sources cited by the model for the web search call.
@@ -320,11 +320,11 @@ declare const openaiTools: {
320
320
  query?: string;
321
321
  } | {
322
322
  type: "openPage";
323
- url: string;
323
+ url?: string | null;
324
324
  } | {
325
325
  type: "find";
326
- url: string;
327
- pattern: string;
326
+ url?: string | null;
327
+ pattern?: string | null;
328
328
  };
329
329
  }, {
330
330
  searchContextSize?: "low" | "medium" | "high";
@@ -333,16 +333,7 @@ declare const openaiTools: {
333
333
  country?: string;
334
334
  city?: string;
335
335
  region?: string;
336
- timezone
337
- /**
338
- * Web search allows models to access up-to-date information from the internet
339
- * and provide answers with sourced citations.
340
- *
341
- * @param filters - The filters to use for the web search.
342
- * @param searchContextSize - The search context size to use for the web search.
343
- * @param userLocation - The user location to use for the web search.
344
- */
345
- ?: string;
336
+ timezone?: string;
346
337
  };
347
338
  }>;
348
339
  /**
@@ -359,11 +350,11 @@ declare const openaiTools: {
359
350
  query?: string;
360
351
  } | {
361
352
  type: "openPage";
362
- url: string;
353
+ url?: string | null;
363
354
  } | {
364
355
  type: "find";
365
- url: string;
366
- pattern: string;
356
+ url?: string | null;
357
+ pattern?: string | null;
367
358
  };
368
359
  sources?: Array<{
369
360
  type: "url";
package/dist/index.js CHANGED
@@ -515,8 +515,7 @@ var openaiChatLanguageModelOptions = (0, import_provider_utils4.lazySchema)(
515
515
  var import_provider2 = require("@ai-sdk/provider");
516
516
  function prepareChatTools({
517
517
  tools,
518
- toolChoice,
519
- strictJsonSchema
518
+ toolChoice
520
519
  }) {
521
520
  tools = (tools == null ? void 0 : tools.length) ? tools : void 0;
522
521
  const toolWarnings = [];
@@ -533,7 +532,7 @@ function prepareChatTools({
533
532
  name: tool.name,
534
533
  description: tool.description,
535
534
  parameters: tool.inputSchema,
536
- strict: strictJsonSchema
535
+ ...tool.strict != null ? { strict: tool.strict } : {}
537
536
  }
538
537
  });
539
538
  break;
@@ -753,8 +752,7 @@ var OpenAIChatLanguageModel = class {
753
752
  toolWarnings
754
753
  } = prepareChatTools({
755
754
  tools,
756
- toolChoice,
757
- strictJsonSchema
755
+ toolChoice
758
756
  });
759
757
  return {
760
758
  args: {
@@ -1974,12 +1972,12 @@ var webSearchOutputSchema = (0, import_provider_utils19.lazySchema)(
1974
1972
  }),
1975
1973
  import_v414.z.object({
1976
1974
  type: import_v414.z.literal("openPage"),
1977
- url: import_v414.z.string()
1975
+ url: import_v414.z.string().nullish()
1978
1976
  }),
1979
1977
  import_v414.z.object({
1980
1978
  type: import_v414.z.literal("find"),
1981
- url: import_v414.z.string(),
1982
- pattern: import_v414.z.string()
1979
+ url: import_v414.z.string().nullish(),
1980
+ pattern: import_v414.z.string().nullish()
1983
1981
  })
1984
1982
  ]),
1985
1983
  sources: import_v414.z.array(
@@ -2028,12 +2026,12 @@ var webSearchPreviewOutputSchema = (0, import_provider_utils20.lazySchema)(
2028
2026
  }),
2029
2027
  import_v415.z.object({
2030
2028
  type: import_v415.z.literal("openPage"),
2031
- url: import_v415.z.string()
2029
+ url: import_v415.z.string().nullish()
2032
2030
  }),
2033
2031
  import_v415.z.object({
2034
2032
  type: import_v415.z.literal("find"),
2035
- url: import_v415.z.string(),
2036
- pattern: import_v415.z.string()
2033
+ url: import_v415.z.string().nullish(),
2034
+ pattern: import_v415.z.string().nullish()
2037
2035
  })
2038
2036
  ])
2039
2037
  })
@@ -2744,12 +2742,12 @@ var openaiResponsesChunkSchema = (0, import_provider_utils23.lazySchema)(
2744
2742
  }),
2745
2743
  import_v418.z.object({
2746
2744
  type: import_v418.z.literal("open_page"),
2747
- url: import_v418.z.string()
2745
+ url: import_v418.z.string().nullish()
2748
2746
  }),
2749
2747
  import_v418.z.object({
2750
2748
  type: import_v418.z.literal("find"),
2751
- url: import_v418.z.string(),
2752
- pattern: import_v418.z.string()
2749
+ url: import_v418.z.string().nullish(),
2750
+ pattern: import_v418.z.string().nullish()
2753
2751
  })
2754
2752
  ])
2755
2753
  }),
@@ -3039,12 +3037,12 @@ var openaiResponsesResponseSchema = (0, import_provider_utils23.lazySchema)(
3039
3037
  }),
3040
3038
  import_v418.z.object({
3041
3039
  type: import_v418.z.literal("open_page"),
3042
- url: import_v418.z.string()
3040
+ url: import_v418.z.string().nullish()
3043
3041
  }),
3044
3042
  import_v418.z.object({
3045
3043
  type: import_v418.z.literal("find"),
3046
- url: import_v418.z.string(),
3047
- pattern: import_v418.z.string()
3044
+ url: import_v418.z.string().nullish(),
3045
+ pattern: import_v418.z.string().nullish()
3048
3046
  })
3049
3047
  ])
3050
3048
  }),
@@ -3409,8 +3407,7 @@ var import_provider7 = require("@ai-sdk/provider");
3409
3407
  var import_provider_utils25 = require("@ai-sdk/provider-utils");
3410
3408
  async function prepareResponsesTools({
3411
3409
  tools,
3412
- toolChoice,
3413
- strictJsonSchema
3410
+ toolChoice
3414
3411
  }) {
3415
3412
  tools = (tools == null ? void 0 : tools.length) ? tools : void 0;
3416
3413
  const toolWarnings = [];
@@ -3426,7 +3423,7 @@ async function prepareResponsesTools({
3426
3423
  name: tool.name,
3427
3424
  description: tool.description,
3428
3425
  parameters: tool.inputSchema,
3429
- strict: strictJsonSchema
3426
+ ...tool.strict != null ? { strict: tool.strict } : {}
3430
3427
  });
3431
3428
  break;
3432
3429
  case "provider": {
@@ -3792,8 +3789,7 @@ var OpenAIResponsesLanguageModel = class {
3792
3789
  toolWarnings
3793
3790
  } = await prepareResponsesTools({
3794
3791
  tools,
3795
- toolChoice,
3796
- strictJsonSchema
3792
+ toolChoice
3797
3793
  });
3798
3794
  return {
3799
3795
  webSearchToolName,
@@ -5257,7 +5253,7 @@ var OpenAITranscriptionModel = class {
5257
5253
  };
5258
5254
 
5259
5255
  // src/version.ts
5260
- var VERSION = true ? "3.0.0-beta.78" : "0.0.0-test";
5256
+ var VERSION = true ? "3.0.0-beta.80" : "0.0.0-test";
5261
5257
 
5262
5258
  // src/openai-provider.ts
5263
5259
  function createOpenAI(options = {}) {