@ai-sdk/openai 3.0.0-beta.94 → 3.0.0-beta.96

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,18 @@
1
1
  # @ai-sdk/openai
2
2
 
3
+ ## 3.0.0-beta.96
4
+
5
+ ### Patch Changes
6
+
7
+ - 817e601: fix(openai); fix url_citation schema in chat api
8
+ - 59561f8: fix(openai); fix url_citation schema in chat api
9
+
10
+ ## 3.0.0-beta.95
11
+
12
+ ### Patch Changes
13
+
14
+ - 40dc7fa: fix(openai): change find action type to find_in_page action type
15
+
3
16
  ## 3.0.0-beta.94
4
17
 
5
18
  ### 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.ProviderToolFactoryWithOutputSchema<{}, {
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, find_in_page).
36
36
  */
37
37
  action: {
38
38
  /**
@@ -54,9 +54,9 @@ declare const webSearchToolFactory: _ai_sdk_provider_utils.ProviderToolFactoryWi
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
  */
@@ -351,7 +351,7 @@ declare const openaiTools: {
351
351
  type: "openPage";
352
352
  url?: string | null;
353
353
  } | {
354
- type: "find";
354
+ type: "findInPage";
355
355
  url?: string | null;
356
356
  pattern?: string | null;
357
357
  };
@@ -381,7 +381,7 @@ declare const openaiTools: {
381
381
  type: "openPage";
382
382
  url?: string | null;
383
383
  } | {
384
- type: "find";
384
+ type: "findInPage";
385
385
  url?: string | null;
386
386
  pattern?: string | null;
387
387
  };
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.ProviderToolFactoryWithOutputSchema<{}, {
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, find_in_page).
36
36
  */
37
37
  action: {
38
38
  /**
@@ -54,9 +54,9 @@ declare const webSearchToolFactory: _ai_sdk_provider_utils.ProviderToolFactoryWi
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
  */
@@ -351,7 +351,7 @@ declare const openaiTools: {
351
351
  type: "openPage";
352
352
  url?: string | null;
353
353
  } | {
354
- type: "find";
354
+ type: "findInPage";
355
355
  url?: string | null;
356
356
  pattern?: string | null;
357
357
  };
@@ -381,7 +381,7 @@ declare const openaiTools: {
381
381
  type: "openPage";
382
382
  url?: string | null;
383
383
  } | {
384
- type: "find";
384
+ type: "findInPage";
385
385
  url?: string | null;
386
386
  pattern?: string | null;
387
387
  };
package/dist/index.js CHANGED
@@ -346,10 +346,12 @@ var openaiChatResponseSchema = (0, import_provider_utils3.lazySchema)(
346
346
  annotations: import_v42.z.array(
347
347
  import_v42.z.object({
348
348
  type: import_v42.z.literal("url_citation"),
349
- start_index: import_v42.z.number(),
350
- end_index: import_v42.z.number(),
351
- url: import_v42.z.string(),
352
- title: import_v42.z.string()
349
+ url_citation: import_v42.z.object({
350
+ start_index: import_v42.z.number(),
351
+ end_index: import_v42.z.number(),
352
+ url: import_v42.z.string(),
353
+ title: import_v42.z.string()
354
+ })
353
355
  })
354
356
  ).nullish()
355
357
  }),
@@ -413,10 +415,12 @@ var openaiChatChunkSchema = (0, import_provider_utils3.lazySchema)(
413
415
  annotations: import_v42.z.array(
414
416
  import_v42.z.object({
415
417
  type: import_v42.z.literal("url_citation"),
416
- start_index: import_v42.z.number(),
417
- end_index: import_v42.z.number(),
418
- url: import_v42.z.string(),
419
- title: import_v42.z.string()
418
+ url_citation: import_v42.z.object({
419
+ start_index: import_v42.z.number(),
420
+ end_index: import_v42.z.number(),
421
+ url: import_v42.z.string(),
422
+ title: import_v42.z.string()
423
+ })
420
424
  })
421
425
  ).nullish()
422
426
  }).nullish(),
@@ -852,8 +856,8 @@ var OpenAIChatLanguageModel = class {
852
856
  type: "source",
853
857
  sourceType: "url",
854
858
  id: (0, import_provider_utils5.generateId)(),
855
- url: annotation.url,
856
- title: annotation.title
859
+ url: annotation.url_citation.url,
860
+ title: annotation.url_citation.title
857
861
  });
858
862
  }
859
863
  const completionTokenDetails = (_d = response.usage) == null ? void 0 : _d.completion_tokens_details;
@@ -1068,8 +1072,8 @@ var OpenAIChatLanguageModel = class {
1068
1072
  type: "source",
1069
1073
  sourceType: "url",
1070
1074
  id: (0, import_provider_utils5.generateId)(),
1071
- url: annotation.url,
1072
- title: annotation.title
1075
+ url: annotation.url_citation.url,
1076
+ title: annotation.url_citation.title
1073
1077
  });
1074
1078
  }
1075
1079
  }
@@ -2064,7 +2068,7 @@ var webSearchOutputSchema = (0, import_provider_utils20.lazySchema)(
2064
2068
  url: import_v415.z.string().nullish()
2065
2069
  }),
2066
2070
  import_v415.z.object({
2067
- type: import_v415.z.literal("find"),
2071
+ type: import_v415.z.literal("findInPage"),
2068
2072
  url: import_v415.z.string().nullish(),
2069
2073
  pattern: import_v415.z.string().nullish()
2070
2074
  })
@@ -2118,7 +2122,7 @@ var webSearchPreviewOutputSchema = (0, import_provider_utils21.lazySchema)(
2118
2122
  url: import_v416.z.string().nullish()
2119
2123
  }),
2120
2124
  import_v416.z.object({
2121
- type: import_v416.z.literal("find"),
2125
+ type: import_v416.z.literal("findInPage"),
2122
2126
  url: import_v416.z.string().nullish(),
2123
2127
  pattern: import_v416.z.string().nullish()
2124
2128
  })
@@ -2932,7 +2936,7 @@ var openaiResponsesChunkSchema = (0, import_provider_utils24.lazySchema)(
2932
2936
  url: import_v419.z.string().nullish()
2933
2937
  }),
2934
2938
  import_v419.z.object({
2935
- type: import_v419.z.literal("find"),
2939
+ type: import_v419.z.literal("find_in_page"),
2936
2940
  url: import_v419.z.string().nullish(),
2937
2941
  pattern: import_v419.z.string().nullish()
2938
2942
  })
@@ -3236,7 +3240,7 @@ var openaiResponsesResponseSchema = (0, import_provider_utils24.lazySchema)(
3236
3240
  url: import_v419.z.string().nullish()
3237
3241
  }),
3238
3242
  import_v419.z.object({
3239
- type: import_v419.z.literal("find"),
3243
+ type: import_v419.z.literal("find_in_page"),
3240
3244
  url: import_v419.z.string().nullish(),
3241
3245
  pattern: import_v419.z.string().nullish()
3242
3246
  })
@@ -5125,9 +5129,13 @@ function mapWebSearchOutput(action) {
5125
5129
  };
5126
5130
  case "open_page":
5127
5131
  return { action: { type: "openPage", url: action.url } };
5128
- case "find":
5132
+ case "find_in_page":
5129
5133
  return {
5130
- action: { type: "find", url: action.url, pattern: action.pattern }
5134
+ action: {
5135
+ type: "findInPage",
5136
+ url: action.url,
5137
+ pattern: action.pattern
5138
+ }
5131
5139
  };
5132
5140
  }
5133
5141
  }
@@ -5485,7 +5493,7 @@ var OpenAITranscriptionModel = class {
5485
5493
  };
5486
5494
 
5487
5495
  // src/version.ts
5488
- var VERSION = true ? "3.0.0-beta.94" : "0.0.0-test";
5496
+ var VERSION = true ? "3.0.0-beta.96" : "0.0.0-test";
5489
5497
 
5490
5498
  // src/openai-provider.ts
5491
5499
  function createOpenAI(options = {}) {