@ai-sdk/openai 3.0.0-beta.48 → 3.0.0-beta.50

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,19 @@
1
1
  # @ai-sdk/openai
2
2
 
3
+ ## 3.0.0-beta.50
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [bb36798]
8
+ - @ai-sdk/provider@3.0.0-beta.15
9
+ - @ai-sdk/provider-utils@4.0.0-beta.31
10
+
11
+ ## 3.0.0-beta.49
12
+
13
+ ### Patch Changes
14
+
15
+ - 0273b74: fix(openai): add support for sources type 'api'
16
+
3
17
  ## 3.0.0-beta.48
4
18
 
5
19
  ### Patch Changes
package/dist/index.d.mts CHANGED
@@ -68,10 +68,13 @@ declare const webSearchToolFactory: _ai_sdk_provider_utils.ProviderDefinedToolFa
68
68
  /**
69
69
  * Optional sources cited by the model for the web search call.
70
70
  */
71
- sources?: {
71
+ sources?: Array<{
72
72
  type: "url";
73
73
  url: string;
74
- }[];
74
+ } | {
75
+ type: "api";
76
+ name: string;
77
+ }>;
75
78
  }, {
76
79
  /**
77
80
  * Filters for the search.
@@ -315,10 +318,13 @@ declare const openaiTools: {
315
318
  url: string;
316
319
  pattern: string;
317
320
  };
318
- sources?: {
321
+ sources?: Array<{
319
322
  type: "url";
320
323
  url: string;
321
- }[];
324
+ } | {
325
+ type: "api";
326
+ name: string;
327
+ }>;
322
328
  }>;
323
329
  };
324
330
 
package/dist/index.d.ts CHANGED
@@ -68,10 +68,13 @@ declare const webSearchToolFactory: _ai_sdk_provider_utils.ProviderDefinedToolFa
68
68
  /**
69
69
  * Optional sources cited by the model for the web search call.
70
70
  */
71
- sources?: {
71
+ sources?: Array<{
72
72
  type: "url";
73
73
  url: string;
74
- }[];
74
+ } | {
75
+ type: "api";
76
+ name: string;
77
+ }>;
75
78
  }, {
76
79
  /**
77
80
  * Filters for the search.
@@ -315,10 +318,13 @@ declare const openaiTools: {
315
318
  url: string;
316
319
  pattern: string;
317
320
  };
318
- sources?: {
321
+ sources?: Array<{
319
322
  type: "url";
320
323
  url: string;
321
- }[];
324
+ } | {
325
+ type: "api";
326
+ name: string;
327
+ }>;
322
328
  }>;
323
329
  };
324
330
 
package/dist/index.js CHANGED
@@ -1939,7 +1939,12 @@ var webSearchOutputSchema = (0, import_provider_utils18.lazySchema)(
1939
1939
  pattern: import_v413.z.string()
1940
1940
  })
1941
1941
  ]),
1942
- sources: import_v413.z.array(import_v413.z.object({ type: import_v413.z.literal("url"), url: import_v413.z.string() })).optional()
1942
+ sources: import_v413.z.array(
1943
+ import_v413.z.discriminatedUnion("type", [
1944
+ import_v413.z.object({ type: import_v413.z.literal("url"), url: import_v413.z.string() }),
1945
+ import_v413.z.object({ type: import_v413.z.literal("api"), name: import_v413.z.string() })
1946
+ ])
1947
+ ).optional()
1943
1948
  })
1944
1949
  )
1945
1950
  );
@@ -2540,7 +2545,12 @@ var openaiResponsesChunkSchema = (0, import_provider_utils21.lazySchema)(
2540
2545
  import_v416.z.object({
2541
2546
  type: import_v416.z.literal("search"),
2542
2547
  query: import_v416.z.string().nullish(),
2543
- sources: import_v416.z.array(import_v416.z.object({ type: import_v416.z.literal("url"), url: import_v416.z.string() })).nullish()
2548
+ sources: import_v416.z.array(
2549
+ import_v416.z.discriminatedUnion("type", [
2550
+ import_v416.z.object({ type: import_v416.z.literal("url"), url: import_v416.z.string() }),
2551
+ import_v416.z.object({ type: import_v416.z.literal("api"), name: import_v416.z.string() })
2552
+ ])
2553
+ ).nullish()
2544
2554
  }),
2545
2555
  import_v416.z.object({
2546
2556
  type: import_v416.z.literal("open_page"),
@@ -2559,7 +2569,10 @@ var openaiResponsesChunkSchema = (0, import_provider_utils21.lazySchema)(
2559
2569
  queries: import_v416.z.array(import_v416.z.string()),
2560
2570
  results: import_v416.z.array(
2561
2571
  import_v416.z.object({
2562
- attributes: import_v416.z.record(import_v416.z.string(), import_v416.z.unknown()),
2572
+ attributes: import_v416.z.record(
2573
+ import_v416.z.string(),
2574
+ import_v416.z.union([import_v416.z.string(), import_v416.z.number(), import_v416.z.boolean()])
2575
+ ),
2563
2576
  file_id: import_v416.z.string(),
2564
2577
  filename: import_v416.z.string(),
2565
2578
  score: import_v416.z.number(),
@@ -2727,7 +2740,12 @@ var openaiResponsesResponseSchema = (0, import_provider_utils21.lazySchema)(
2727
2740
  import_v416.z.object({
2728
2741
  type: import_v416.z.literal("search"),
2729
2742
  query: import_v416.z.string().nullish(),
2730
- sources: import_v416.z.array(import_v416.z.object({ type: import_v416.z.literal("url"), url: import_v416.z.string() })).nullish()
2743
+ sources: import_v416.z.array(
2744
+ import_v416.z.discriminatedUnion("type", [
2745
+ import_v416.z.object({ type: import_v416.z.literal("url"), url: import_v416.z.string() }),
2746
+ import_v416.z.object({ type: import_v416.z.literal("api"), name: import_v416.z.string() })
2747
+ ])
2748
+ ).nullish()
2731
2749
  }),
2732
2750
  import_v416.z.object({
2733
2751
  type: import_v416.z.literal("open_page"),
@@ -2746,7 +2764,10 @@ var openaiResponsesResponseSchema = (0, import_provider_utils21.lazySchema)(
2746
2764
  queries: import_v416.z.array(import_v416.z.string()),
2747
2765
  results: import_v416.z.array(
2748
2766
  import_v416.z.object({
2749
- attributes: import_v416.z.record(import_v416.z.string(), import_v416.z.unknown()),
2767
+ attributes: import_v416.z.record(
2768
+ import_v416.z.string(),
2769
+ import_v416.z.union([import_v416.z.string(), import_v416.z.number(), import_v416.z.boolean()])
2770
+ ),
2750
2771
  file_id: import_v416.z.string(),
2751
2772
  filename: import_v416.z.string(),
2752
2773
  score: import_v416.z.number(),
@@ -4465,7 +4486,7 @@ var OpenAITranscriptionModel = class {
4465
4486
  };
4466
4487
 
4467
4488
  // src/version.ts
4468
- var VERSION = true ? "3.0.0-beta.48" : "0.0.0-test";
4489
+ var VERSION = true ? "3.0.0-beta.50" : "0.0.0-test";
4469
4490
 
4470
4491
  // src/openai-provider.ts
4471
4492
  function createOpenAI(options = {}) {