@ai-sdk/openai 2.0.84 → 2.0.86

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,17 @@
1
1
  # @ai-sdk/openai
2
2
 
3
+ ## 2.0.86
4
+
5
+ ### Patch Changes
6
+
7
+ - a909bcf: fix(openai); fix url_citation schema in chat api
8
+
9
+ ## 2.0.85
10
+
11
+ ### Patch Changes
12
+
13
+ - e79430b: fix(openai): change find action type to find_in_page action type
14
+
3
15
  ## 2.0.84
4
16
 
5
17
  ### Patch Changes
package/dist/index.d.mts CHANGED
@@ -32,7 +32,7 @@ type OpenAIImageModelId = 'dall-e-3' | 'dall-e-2' | 'gpt-image-1' | 'gpt-image-1
32
32
  declare const webSearchToolFactory: _ai_sdk_provider_utils.ProviderDefinedToolFactoryWithOutputSchema<{}, {
33
33
  /**
34
34
  * An object describing the specific action taken in this web search call.
35
- * Includes details on how the model used the web (search, open_page, find).
35
+ * Includes details on how the model used the web (search, open_page, findInPage).
36
36
  */
37
37
  action: {
38
38
  /**
@@ -54,9 +54,9 @@ declare const webSearchToolFactory: _ai_sdk_provider_utils.ProviderDefinedToolFa
54
54
  url?: string | null;
55
55
  } | {
56
56
  /**
57
- * Action type "find": Searches for a pattern within a loaded page.
57
+ * Action type "findInPage": Searches for a pattern within a loaded page.
58
58
  */
59
- type: "find";
59
+ type: "findInPage";
60
60
  /**
61
61
  * The URL of the page searched for the pattern.
62
62
  */
@@ -283,7 +283,7 @@ declare const openaiTools: {
283
283
  type: "openPage";
284
284
  url?: string | null;
285
285
  } | {
286
- type: "find";
286
+ type: "findInPage";
287
287
  url?: string | null;
288
288
  pattern?: string | null;
289
289
  };
@@ -315,7 +315,7 @@ declare const openaiTools: {
315
315
  type: "openPage";
316
316
  url?: string | null;
317
317
  } | {
318
- type: "find";
318
+ type: "findInPage";
319
319
  url?: string | null;
320
320
  pattern?: string | null;
321
321
  };
package/dist/index.d.ts CHANGED
@@ -32,7 +32,7 @@ type OpenAIImageModelId = 'dall-e-3' | 'dall-e-2' | 'gpt-image-1' | 'gpt-image-1
32
32
  declare const webSearchToolFactory: _ai_sdk_provider_utils.ProviderDefinedToolFactoryWithOutputSchema<{}, {
33
33
  /**
34
34
  * An object describing the specific action taken in this web search call.
35
- * Includes details on how the model used the web (search, open_page, find).
35
+ * Includes details on how the model used the web (search, open_page, findInPage).
36
36
  */
37
37
  action: {
38
38
  /**
@@ -54,9 +54,9 @@ declare const webSearchToolFactory: _ai_sdk_provider_utils.ProviderDefinedToolFa
54
54
  url?: string | null;
55
55
  } | {
56
56
  /**
57
- * Action type "find": Searches for a pattern within a loaded page.
57
+ * Action type "findInPage": Searches for a pattern within a loaded page.
58
58
  */
59
- type: "find";
59
+ type: "findInPage";
60
60
  /**
61
61
  * The URL of the page searched for the pattern.
62
62
  */
@@ -283,7 +283,7 @@ declare const openaiTools: {
283
283
  type: "openPage";
284
284
  url?: string | null;
285
285
  } | {
286
- type: "find";
286
+ type: "findInPage";
287
287
  url?: string | null;
288
288
  pattern?: string | null;
289
289
  };
@@ -315,7 +315,7 @@ declare const openaiTools: {
315
315
  type: "openPage";
316
316
  url?: string | null;
317
317
  } | {
318
- type: "find";
318
+ type: "findInPage";
319
319
  url?: string | null;
320
320
  pattern?: string | null;
321
321
  };
package/dist/index.js CHANGED
@@ -303,10 +303,12 @@ var openaiChatResponseSchema = (0, import_provider_utils3.lazyValidator)(
303
303
  annotations: import_v42.z.array(
304
304
  import_v42.z.object({
305
305
  type: import_v42.z.literal("url_citation"),
306
- start_index: import_v42.z.number(),
307
- end_index: import_v42.z.number(),
308
- url: import_v42.z.string(),
309
- title: import_v42.z.string()
306
+ url_citation: import_v42.z.object({
307
+ start_index: import_v42.z.number(),
308
+ end_index: import_v42.z.number(),
309
+ url: import_v42.z.string(),
310
+ title: import_v42.z.string()
311
+ })
310
312
  })
311
313
  ).nullish()
312
314
  }),
@@ -370,10 +372,12 @@ var openaiChatChunkSchema = (0, import_provider_utils3.lazyValidator)(
370
372
  annotations: import_v42.z.array(
371
373
  import_v42.z.object({
372
374
  type: import_v42.z.literal("url_citation"),
373
- start_index: import_v42.z.number(),
374
- end_index: import_v42.z.number(),
375
- url: import_v42.z.string(),
376
- title: import_v42.z.string()
375
+ url_citation: import_v42.z.object({
376
+ start_index: import_v42.z.number(),
377
+ end_index: import_v42.z.number(),
378
+ url: import_v42.z.string(),
379
+ title: import_v42.z.string()
380
+ })
377
381
  })
378
382
  ).nullish()
379
383
  }).nullish(),
@@ -827,8 +831,8 @@ var OpenAIChatLanguageModel = class {
827
831
  type: "source",
828
832
  sourceType: "url",
829
833
  id: (0, import_provider_utils5.generateId)(),
830
- url: annotation.url,
831
- title: annotation.title
834
+ url: annotation.url_citation.url,
835
+ title: annotation.url_citation.title
832
836
  });
833
837
  }
834
838
  const completionTokenDetails = (_d = response.usage) == null ? void 0 : _d.completion_tokens_details;
@@ -1057,8 +1061,8 @@ var OpenAIChatLanguageModel = class {
1057
1061
  type: "source",
1058
1062
  sourceType: "url",
1059
1063
  id: (0, import_provider_utils5.generateId)(),
1060
- url: annotation.url,
1061
- title: annotation.title
1064
+ url: annotation.url_citation.url,
1065
+ title: annotation.url_citation.title
1062
1066
  });
1063
1067
  }
1064
1068
  }
@@ -1944,7 +1948,7 @@ var webSearchOutputSchema = (0, import_provider_utils18.lazySchema)(
1944
1948
  url: import_v413.z.string().nullish()
1945
1949
  }),
1946
1950
  import_v413.z.object({
1947
- type: import_v413.z.literal("find"),
1951
+ type: import_v413.z.literal("findInPage"),
1948
1952
  url: import_v413.z.string().nullish(),
1949
1953
  pattern: import_v413.z.string().nullish()
1950
1954
  })
@@ -1999,7 +2003,7 @@ var webSearchPreviewOutputSchema = (0, import_provider_utils19.lazySchema)(
1999
2003
  url: import_v414.z.string().nullish()
2000
2004
  }),
2001
2005
  import_v414.z.object({
2002
- type: import_v414.z.literal("find"),
2006
+ type: import_v414.z.literal("findInPage"),
2003
2007
  url: import_v414.z.string().nullish(),
2004
2008
  pattern: import_v414.z.string().nullish()
2005
2009
  })
@@ -2548,7 +2552,7 @@ var openaiResponsesChunkSchema = (0, import_provider_utils21.lazyValidator)(
2548
2552
  url: import_v416.z.string().nullish()
2549
2553
  }),
2550
2554
  import_v416.z.object({
2551
- type: import_v416.z.literal("find"),
2555
+ type: import_v416.z.literal("find_in_page"),
2552
2556
  url: import_v416.z.string().nullish(),
2553
2557
  pattern: import_v416.z.string().nullish()
2554
2558
  })
@@ -2758,7 +2762,7 @@ var openaiResponsesResponseSchema = (0, import_provider_utils21.lazyValidator)(
2758
2762
  url: import_v416.z.string().nullish()
2759
2763
  }),
2760
2764
  import_v416.z.object({
2761
- type: import_v416.z.literal("find"),
2765
+ type: import_v416.z.literal("find_in_page"),
2762
2766
  url: import_v416.z.string().nullish(),
2763
2767
  pattern: import_v416.z.string().nullish()
2764
2768
  })
@@ -4195,9 +4199,13 @@ function mapWebSearchOutput(action) {
4195
4199
  };
4196
4200
  case "open_page":
4197
4201
  return { action: { type: "openPage", url: action.url } };
4198
- case "find":
4202
+ case "find_in_page":
4199
4203
  return {
4200
- action: { type: "find", url: action.url, pattern: action.pattern }
4204
+ action: {
4205
+ type: "findInPage",
4206
+ url: action.url,
4207
+ pattern: action.pattern
4208
+ }
4201
4209
  };
4202
4210
  }
4203
4211
  }
@@ -4555,7 +4563,7 @@ var OpenAITranscriptionModel = class {
4555
4563
  };
4556
4564
 
4557
4565
  // src/version.ts
4558
- var VERSION = true ? "2.0.84" : "0.0.0-test";
4566
+ var VERSION = true ? "2.0.86" : "0.0.0-test";
4559
4567
 
4560
4568
  // src/openai-provider.ts
4561
4569
  function createOpenAI(options = {}) {