@ai-sdk/openai 4.0.0-beta.40 → 4.0.0-beta.41

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.
Files changed (45) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/dist/index.d.ts +6 -6
  3. package/dist/index.js +176 -118
  4. package/dist/index.js.map +1 -1
  5. package/dist/internal/index.d.ts +2 -2
  6. package/dist/internal/index.js +162 -107
  7. package/dist/internal/index.js.map +1 -1
  8. package/docs/03-openai.mdx +18 -13
  9. package/package.json +4 -4
  10. package/src/chat/convert-openai-chat-usage.ts +1 -1
  11. package/src/chat/convert-to-openai-chat-messages.ts +85 -72
  12. package/src/chat/map-openai-finish-reason.ts +1 -1
  13. package/src/chat/openai-chat-api.ts +6 -2
  14. package/src/chat/openai-chat-language-model.ts +6 -6
  15. package/src/chat/openai-chat-options.ts +5 -1
  16. package/src/chat/openai-chat-prepare-tools.ts +3 -3
  17. package/src/completion/convert-openai-completion-usage.ts +1 -1
  18. package/src/completion/convert-to-openai-completion-prompt.ts +1 -2
  19. package/src/completion/map-openai-finish-reason.ts +1 -1
  20. package/src/completion/openai-completion-api.ts +5 -2
  21. package/src/completion/openai-completion-language-model.ts +6 -7
  22. package/src/completion/openai-completion-options.ts +5 -1
  23. package/src/embedding/openai-embedding-model.ts +3 -3
  24. package/src/embedding/openai-embedding-options.ts +5 -1
  25. package/src/files/openai-files-options.ts +5 -1
  26. package/src/files/openai-files.ts +5 -7
  27. package/src/image/openai-image-model.ts +3 -4
  28. package/src/openai-config.ts +1 -1
  29. package/src/openai-provider.ts +9 -9
  30. package/src/responses/convert-openai-responses-usage.ts +1 -1
  31. package/src/responses/convert-to-openai-responses-input.ts +72 -60
  32. package/src/responses/map-openai-responses-finish-reason.ts +1 -1
  33. package/src/responses/openai-responses-api.ts +6 -2
  34. package/src/responses/openai-responses-language-model.ts +35 -35
  35. package/src/responses/openai-responses-options.ts +5 -1
  36. package/src/responses/openai-responses-prepare-tools.ts +5 -5
  37. package/src/responses/openai-responses-provider-metadata.ts +2 -2
  38. package/src/skills/openai-skills.ts +4 -8
  39. package/src/speech/openai-speech-model.ts +4 -5
  40. package/src/speech/openai-speech-options.ts +5 -1
  41. package/src/tool/file-search.ts +1 -1
  42. package/src/tool/mcp.ts +1 -1
  43. package/src/tool/tool-search.ts +2 -2
  44. package/src/transcription/openai-transcription-model.ts +4 -5
  45. package/src/transcription/openai-transcription-options.ts +5 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # @ai-sdk/openai
2
2
 
3
+ ## 4.0.0-beta.41
4
+
5
+ ### Patch Changes
6
+
7
+ - 9bd6512: feat(provider): change file part data property to be tagged with a type and remove the image part type
8
+ - 258c093: chore: ensure consistent import handling and avoid import duplicates or cycles
9
+ - Updated dependencies [9bd6512]
10
+ - Updated dependencies [258c093]
11
+ - Updated dependencies [b6783da]
12
+ - @ai-sdk/provider-utils@5.0.0-beta.29
13
+ - @ai-sdk/provider@4.0.0-beta.14
14
+
3
15
  ## 4.0.0-beta.40
4
16
 
5
17
  ### Patch Changes
package/dist/index.d.ts CHANGED
@@ -704,7 +704,7 @@ declare const openaiTools: {
704
704
  * @param description - An optional description of the tool.
705
705
  * @param format - The output format constraint (grammar type, syntax, and definition).
706
706
  */
707
- customTool: (args: Parameters<typeof customToolFactory>[0]) => _ai_sdk_provider_utils.Tool<string, unknown, {}>;
707
+ customTool: (args: Parameters<typeof customToolFactory>[0]) => _ai_sdk_provider_utils.ProviderDefinedTool<string, unknown, {}>;
708
708
  /**
709
709
  * The Code Interpreter tool allows models to write and run Python code in a
710
710
  * sandboxed environment to solve complex problems in domains like data analysis,
@@ -716,7 +716,7 @@ declare const openaiTools: {
716
716
  container?: string | {
717
717
  fileIds?: string[];
718
718
  };
719
- }) => _ai_sdk_provider_utils.Tool<{
719
+ }) => _ai_sdk_provider_utils.ProviderExecutedTool<{
720
720
  code?: string | null;
721
721
  containerId: string;
722
722
  }, {
@@ -786,7 +786,7 @@ declare const openaiTools: {
786
786
  partialImages?: number;
787
787
  quality?: "auto" | "low" | "medium" | "high";
788
788
  size?: "auto" | "1024x1024" | "1024x1536" | "1536x1024";
789
- }) => _ai_sdk_provider_utils.Tool<{}, {
789
+ }) => _ai_sdk_provider_utils.ProviderExecutedTool<{}, {
790
790
  result: string;
791
791
  }, {}>;
792
792
  /**
@@ -928,7 +928,7 @@ declare const openaiTools: {
928
928
  * @param searchContextSize - The search context size to use for the web search.
929
929
  * @param userLocation - The user location to use for the web search.
930
930
  */
931
- webSearch: (args?: Parameters<typeof webSearchToolFactory>[0]) => _ai_sdk_provider_utils.Tool<{}, {
931
+ webSearch: (args?: Parameters<typeof webSearchToolFactory>[0]) => _ai_sdk_provider_utils.ProviderExecutedTool<{}, {
932
932
  action?: {
933
933
  type: "search";
934
934
  query?: string;
@@ -977,7 +977,7 @@ declare const openaiTools: {
977
977
  };
978
978
  serverDescription?: string;
979
979
  serverUrl?: string;
980
- }) => _ai_sdk_provider_utils.Tool<{}, {
980
+ }) => _ai_sdk_provider_utils.ProviderExecutedTool<{}, {
981
981
  type: "call";
982
982
  serverLabel: string;
983
983
  name: string;
@@ -1003,7 +1003,7 @@ declare const openaiTools: {
1003
1003
  execution?: "server" | "client";
1004
1004
  description?: string;
1005
1005
  parameters?: Record<string, unknown>;
1006
- }, {}>>[0]) => _ai_sdk_provider_utils.Tool<{
1006
+ }, {}>>[0]) => _ai_sdk_provider_utils.ProviderDefinedTool<{
1007
1007
  arguments?: unknown;
1008
1008
  call_id?: string | null;
1009
1009
  }, {
package/dist/index.js CHANGED
@@ -101,7 +101,8 @@ import {
101
101
  } from "@ai-sdk/provider";
102
102
  import {
103
103
  convertToBase64,
104
- isProviderReference,
104
+ getTopLevelMediaType,
105
+ resolveFullMediaType,
105
106
  resolveProviderReference
106
107
  } from "@ai-sdk/provider-utils";
107
108
  function serializeToolCallArguments(input) {
@@ -156,75 +157,89 @@ function convertToOpenAIChatMessages({
156
157
  return { type: "text", text: part.text };
157
158
  }
158
159
  case "file": {
159
- if (isProviderReference(part.data)) {
160
- return {
161
- type: "file",
162
- file: {
163
- file_id: resolveProviderReference({
164
- reference: part.data,
165
- provider: "openai"
166
- })
167
- }
168
- };
169
- }
170
- if (part.mediaType.startsWith("image/")) {
171
- const mediaType = part.mediaType === "image/*" ? "image/jpeg" : part.mediaType;
172
- return {
173
- type: "image_url",
174
- image_url: {
175
- url: part.data instanceof URL ? part.data.toString() : `data:${mediaType};base64,${convertToBase64(part.data)}`,
176
- detail: (_b = (_a2 = part.providerOptions) == null ? void 0 : _a2.openai) == null ? void 0 : _b.imageDetail
177
- }
178
- };
179
- } else if (part.mediaType.startsWith("audio/")) {
180
- if (part.data instanceof URL) {
160
+ switch (part.data.type) {
161
+ case "reference": {
162
+ return {
163
+ type: "file",
164
+ file: {
165
+ file_id: resolveProviderReference({
166
+ reference: part.data.reference,
167
+ provider: "openai"
168
+ })
169
+ }
170
+ };
171
+ }
172
+ case "text": {
181
173
  throw new UnsupportedFunctionalityError({
182
- functionality: "audio file parts with URLs"
174
+ functionality: "text file parts"
183
175
  });
184
176
  }
185
- switch (part.mediaType) {
186
- case "audio/wav": {
177
+ case "url":
178
+ case "data": {
179
+ const topLevel = getTopLevelMediaType(part.mediaType);
180
+ if (topLevel === "image") {
187
181
  return {
188
- type: "input_audio",
189
- input_audio: {
190
- data: convertToBase64(part.data),
191
- format: "wav"
182
+ type: "image_url",
183
+ image_url: {
184
+ url: part.data.type === "url" ? part.data.url.toString() : convertToBase64(part.data.data),
185
+ detail: (_b = (_a2 = part.providerOptions) == null ? void 0 : _a2.openai) == null ? void 0 : _b.imageDetail
192
186
  }
193
187
  };
188
+ } else if (topLevel === "audio") {
189
+ if (part.data.type === "url") {
190
+ throw new UnsupportedFunctionalityError({
191
+ functionality: "audio file parts with URLs"
192
+ });
193
+ }
194
+ const fullMediaType = resolveFullMediaType({ part });
195
+ switch (fullMediaType) {
196
+ case "audio/wav": {
197
+ return {
198
+ type: "input_audio",
199
+ input_audio: {
200
+ data: convertToBase64(part.data.data),
201
+ format: "wav"
202
+ }
203
+ };
204
+ }
205
+ case "audio/mp3":
206
+ case "audio/mpeg": {
207
+ return {
208
+ type: "input_audio",
209
+ input_audio: {
210
+ data: convertToBase64(part.data.data),
211
+ format: "mp3"
212
+ }
213
+ };
214
+ }
215
+ default: {
216
+ throw new UnsupportedFunctionalityError({
217
+ functionality: `audio content parts with media type ${fullMediaType}`
218
+ });
219
+ }
220
+ }
194
221
  }
195
- case "audio/mp3":
196
- case "audio/mpeg": {
222
+ {
223
+ const fullMediaType = resolveFullMediaType({ part });
224
+ if (fullMediaType !== "application/pdf") {
225
+ throw new UnsupportedFunctionalityError({
226
+ functionality: `file part media type ${fullMediaType}`
227
+ });
228
+ }
229
+ if (part.data.type === "url") {
230
+ throw new UnsupportedFunctionalityError({
231
+ functionality: "PDF file parts with URLs"
232
+ });
233
+ }
197
234
  return {
198
- type: "input_audio",
199
- input_audio: {
200
- data: convertToBase64(part.data),
201
- format: "mp3"
235
+ type: "file",
236
+ file: {
237
+ filename: (_c = part.filename) != null ? _c : `part-${index}.pdf`,
238
+ file_data: `data:application/pdf;base64,${convertToBase64(part.data.data)}`
202
239
  }
203
240
  };
204
241
  }
205
- default: {
206
- throw new UnsupportedFunctionalityError({
207
- functionality: `audio content parts with media type ${part.mediaType}`
208
- });
209
- }
210
- }
211
- } else if (part.mediaType === "application/pdf") {
212
- if (part.data instanceof URL) {
213
- throw new UnsupportedFunctionalityError({
214
- functionality: "PDF file parts with URLs"
215
- });
216
242
  }
217
- return {
218
- type: "file",
219
- file: {
220
- filename: (_c = part.filename) != null ? _c : `part-${index}.pdf`,
221
- file_data: `data:application/pdf;base64,${convertToBase64(part.data)}`
222
- }
223
- };
224
- } else {
225
- throw new UnsupportedFunctionalityError({
226
- functionality: `file part media type ${part.mediaType}`
227
- });
228
243
  }
229
244
  }
230
245
  }
@@ -330,7 +345,10 @@ function mapOpenAIFinishReason(finishReason) {
330
345
  }
331
346
 
332
347
  // src/chat/openai-chat-api.ts
333
- import { lazySchema, zodSchema } from "@ai-sdk/provider-utils";
348
+ import {
349
+ lazySchema,
350
+ zodSchema
351
+ } from "@ai-sdk/provider-utils";
334
352
  import { z as z2 } from "zod/v4";
335
353
  var openaiChatResponseSchema = lazySchema(
336
354
  () => zodSchema(
@@ -472,7 +490,10 @@ var openaiChatChunkSchema = lazySchema(
472
490
  );
473
491
 
474
492
  // src/chat/openai-chat-options.ts
475
- import { lazySchema as lazySchema2, zodSchema as zodSchema2 } from "@ai-sdk/provider-utils";
493
+ import {
494
+ lazySchema as lazySchema2,
495
+ zodSchema as zodSchema2
496
+ } from "@ai-sdk/provider-utils";
476
497
  import { z as z3 } from "zod/v4";
477
498
  var openaiLanguageModelChatOptions = lazySchema2(
478
499
  () => zodSchema2(
@@ -1230,7 +1251,10 @@ function mapOpenAIFinishReason2(finishReason) {
1230
1251
 
1231
1252
  // src/completion/openai-completion-api.ts
1232
1253
  import { z as z4 } from "zod/v4";
1233
- import { lazySchema as lazySchema3, zodSchema as zodSchema3 } from "@ai-sdk/provider-utils";
1254
+ import {
1255
+ lazySchema as lazySchema3,
1256
+ zodSchema as zodSchema3
1257
+ } from "@ai-sdk/provider-utils";
1234
1258
  var openaiCompletionResponseSchema = lazySchema3(
1235
1259
  () => zodSchema3(
1236
1260
  z4.object({
@@ -1287,7 +1311,10 @@ var openaiCompletionChunkSchema = lazySchema3(
1287
1311
  );
1288
1312
 
1289
1313
  // src/completion/openai-completion-options.ts
1290
- import { lazySchema as lazySchema4, zodSchema as zodSchema4 } from "@ai-sdk/provider-utils";
1314
+ import {
1315
+ lazySchema as lazySchema4,
1316
+ zodSchema as zodSchema4
1317
+ } from "@ai-sdk/provider-utils";
1291
1318
  import { z as z5 } from "zod/v4";
1292
1319
  var openaiLanguageModelCompletionOptions = lazySchema4(
1293
1320
  () => zodSchema4(
@@ -1588,7 +1615,10 @@ import {
1588
1615
  } from "@ai-sdk/provider-utils";
1589
1616
 
1590
1617
  // src/embedding/openai-embedding-options.ts
1591
- import { lazySchema as lazySchema5, zodSchema as zodSchema5 } from "@ai-sdk/provider-utils";
1618
+ import {
1619
+ lazySchema as lazySchema5,
1620
+ zodSchema as zodSchema5
1621
+ } from "@ai-sdk/provider-utils";
1592
1622
  import { z as z6 } from "zod/v4";
1593
1623
  var openaiEmbeddingModelOptions = lazySchema5(
1594
1624
  () => zodSchema5(
@@ -1696,7 +1726,7 @@ var OpenAIEmbeddingModel = class _OpenAIEmbeddingModel {
1696
1726
  // src/files/openai-files.ts
1697
1727
  import {
1698
1728
  combineHeaders as combineHeaders4,
1699
- convertBase64ToUint8Array,
1729
+ convertInlineFileDataToUint8Array,
1700
1730
  createJsonResponseHandler as createJsonResponseHandler4,
1701
1731
  parseProviderOptions as parseProviderOptions4,
1702
1732
  postFormDataToApi
@@ -1721,7 +1751,10 @@ var openaiFilesResponseSchema = lazySchema7(
1721
1751
  );
1722
1752
 
1723
1753
  // src/files/openai-files-options.ts
1724
- import { lazySchema as lazySchema8, zodSchema as zodSchema8 } from "@ai-sdk/provider-utils";
1754
+ import {
1755
+ lazySchema as lazySchema8,
1756
+ zodSchema as zodSchema8
1757
+ } from "@ai-sdk/provider-utils";
1725
1758
  import { z as z9 } from "zod/v4";
1726
1759
  var openaiFilesOptionsSchema = lazySchema8(
1727
1760
  () => zodSchema8(
@@ -1758,7 +1791,7 @@ var OpenAIFiles = class {
1758
1791
  providerOptions,
1759
1792
  schema: openaiFilesOptionsSchema
1760
1793
  });
1761
- const fileBytes = data instanceof Uint8Array ? data : convertBase64ToUint8Array(data);
1794
+ const fileBytes = convertInlineFileDataToUint8Array(data);
1762
1795
  const blob = new Blob([fileBytes], {
1763
1796
  type: mediaType
1764
1797
  });
@@ -1804,7 +1837,7 @@ var OpenAIFiles = class {
1804
1837
  // src/image/openai-image-model.ts
1805
1838
  import {
1806
1839
  combineHeaders as combineHeaders5,
1807
- convertBase64ToUint8Array as convertBase64ToUint8Array2,
1840
+ convertBase64ToUint8Array,
1808
1841
  convertToFormData,
1809
1842
  createJsonResponseHandler as createJsonResponseHandler5,
1810
1843
  downloadBlob,
@@ -1932,7 +1965,7 @@ var OpenAIImageModel = class _OpenAIImageModel {
1932
1965
  [
1933
1966
  file.data instanceof Uint8Array ? new Blob([file.data], {
1934
1967
  type: file.mediaType
1935
- }) : new Blob([convertBase64ToUint8Array2(file.data)], {
1968
+ }) : new Blob([convertBase64ToUint8Array(file.data)], {
1936
1969
  type: file.mediaType
1937
1970
  })
1938
1971
  ],
@@ -2066,7 +2099,7 @@ async function fileToBlob(file) {
2066
2099
  if (file.type === "url") {
2067
2100
  return downloadBlob(file.url);
2068
2101
  }
2069
- const data = file.data instanceof Uint8Array ? file.data : convertBase64ToUint8Array2(file.data);
2102
+ const data = file.data instanceof Uint8Array ? file.data : convertBase64ToUint8Array(file.data);
2070
2103
  return new Blob([data], { type: file.mediaType });
2071
2104
  }
2072
2105
 
@@ -2812,10 +2845,11 @@ import {
2812
2845
  } from "@ai-sdk/provider";
2813
2846
  import {
2814
2847
  convertToBase64 as convertToBase642,
2848
+ getTopLevelMediaType as getTopLevelMediaType2,
2815
2849
  isNonNullable,
2816
- isProviderReference as isProviderReference2,
2817
2850
  parseJSON,
2818
2851
  parseProviderOptions as parseProviderOptions5,
2852
+ resolveFullMediaType as resolveFullMediaType2,
2819
2853
  resolveProviderReference as resolveProviderReference2,
2820
2854
  validateTypes
2821
2855
  } from "@ai-sdk/provider-utils";
@@ -2882,50 +2916,62 @@ async function convertToOpenAIResponsesInput({
2882
2916
  return { type: "input_text", text: part.text };
2883
2917
  }
2884
2918
  case "file": {
2885
- if (isProviderReference2(part.data)) {
2886
- const fileId = resolveProviderReference2({
2887
- reference: part.data,
2888
- provider: providerOptionsName
2889
- });
2890
- if (part.mediaType.startsWith("image/")) {
2891
- return {
2892
- type: "input_image",
2893
- file_id: fileId,
2894
- detail: (_b2 = (_a2 = part.providerOptions) == null ? void 0 : _a2[providerOptionsName]) == null ? void 0 : _b2.imageDetail
2895
- };
2896
- }
2897
- return {
2898
- type: "input_file",
2899
- file_id: fileId
2900
- };
2901
- }
2902
- if (part.mediaType.startsWith("image/")) {
2903
- const mediaType = part.mediaType === "image/*" ? "image/jpeg" : part.mediaType;
2904
- return {
2905
- type: "input_image",
2906
- ...part.data instanceof URL ? { image_url: part.data.toString() } : typeof part.data === "string" && isFileId(part.data, fileIdPrefixes) ? { file_id: part.data } : {
2907
- image_url: `data:${mediaType};base64,${convertToBase642(part.data)}`
2908
- },
2909
- detail: (_d2 = (_c2 = part.providerOptions) == null ? void 0 : _c2[providerOptionsName]) == null ? void 0 : _d2.imageDetail
2910
- };
2911
- } else if (part.mediaType === "application/pdf") {
2912
- if (part.data instanceof URL) {
2919
+ switch (part.data.type) {
2920
+ case "reference": {
2921
+ const fileId = resolveProviderReference2({
2922
+ reference: part.data.reference,
2923
+ provider: providerOptionsName
2924
+ });
2925
+ if (getTopLevelMediaType2(part.mediaType) === "image") {
2926
+ return {
2927
+ type: "input_image",
2928
+ file_id: fileId,
2929
+ detail: (_b2 = (_a2 = part.providerOptions) == null ? void 0 : _a2[providerOptionsName]) == null ? void 0 : _b2.imageDetail
2930
+ };
2931
+ }
2913
2932
  return {
2914
2933
  type: "input_file",
2915
- file_url: part.data.toString()
2934
+ file_id: fileId
2916
2935
  };
2917
2936
  }
2918
- return {
2919
- type: "input_file",
2920
- ...typeof part.data === "string" && isFileId(part.data, fileIdPrefixes) ? { file_id: part.data } : {
2921
- filename: (_e2 = part.filename) != null ? _e2 : `part-${index}.pdf`,
2922
- file_data: `data:application/pdf;base64,${convertToBase642(part.data)}`
2937
+ case "text": {
2938
+ throw new UnsupportedFunctionalityError4({
2939
+ functionality: "text file parts"
2940
+ });
2941
+ }
2942
+ case "url":
2943
+ case "data": {
2944
+ const topLevel = getTopLevelMediaType2(part.mediaType);
2945
+ if (topLevel === "image") {
2946
+ return {
2947
+ type: "input_image",
2948
+ ...part.data.type === "url" ? { image_url: part.data.url.toString() } : typeof part.data.data === "string" && isFileId(part.data.data, fileIdPrefixes) ? { file_id: part.data.data } : {
2949
+ image_url: `data:${resolveFullMediaType2({ part })};base64,${convertToBase642(part.data.data)}`
2950
+ },
2951
+ detail: (_d2 = (_c2 = part.providerOptions) == null ? void 0 : _c2[providerOptionsName]) == null ? void 0 : _d2.imageDetail
2952
+ };
2953
+ } else {
2954
+ if (part.data.type === "url") {
2955
+ return {
2956
+ type: "input_file",
2957
+ file_url: part.data.url.toString()
2958
+ };
2959
+ }
2960
+ const fullMediaType = resolveFullMediaType2({ part });
2961
+ if (fullMediaType !== "application/pdf") {
2962
+ throw new UnsupportedFunctionalityError4({
2963
+ functionality: `file part media type ${fullMediaType}`
2964
+ });
2965
+ }
2966
+ return {
2967
+ type: "input_file",
2968
+ ...typeof part.data.data === "string" && isFileId(part.data.data, fileIdPrefixes) ? { file_id: part.data.data } : {
2969
+ filename: (_e2 = part.filename) != null ? _e2 : `part-${index}.pdf`,
2970
+ file_data: `data:application/pdf;base64,${convertToBase642(part.data.data)}`
2971
+ }
2972
+ };
2923
2973
  }
2924
- };
2925
- } else {
2926
- throw new UnsupportedFunctionalityError4({
2927
- functionality: `file part media type ${part.mediaType}`
2928
- });
2974
+ }
2929
2975
  }
2930
2976
  }
2931
2977
  }
@@ -3488,7 +3534,10 @@ function mapOpenAIResponseFinishReason({
3488
3534
  }
3489
3535
 
3490
3536
  // src/responses/openai-responses-api.ts
3491
- import { lazySchema as lazySchema21, zodSchema as zodSchema21 } from "@ai-sdk/provider-utils";
3537
+ import {
3538
+ lazySchema as lazySchema21,
3539
+ zodSchema as zodSchema21
3540
+ } from "@ai-sdk/provider-utils";
3492
3541
  import { z as z23 } from "zod/v4";
3493
3542
  var jsonValueSchema2 = z23.lazy(
3494
3543
  () => z23.union([
@@ -4348,7 +4397,10 @@ var openaiResponsesResponseSchema = lazySchema21(
4348
4397
  );
4349
4398
 
4350
4399
  // src/responses/openai-responses-options.ts
4351
- import { lazySchema as lazySchema22, zodSchema as zodSchema22 } from "@ai-sdk/provider-utils";
4400
+ import {
4401
+ lazySchema as lazySchema22,
4402
+ zodSchema as zodSchema22
4403
+ } from "@ai-sdk/provider-utils";
4352
4404
  import { z as z24 } from "zod/v4";
4353
4405
  var TOP_LOGPROBS_MAX = 20;
4354
4406
  var openaiResponsesReasoningModelIds = [
@@ -6608,7 +6660,10 @@ import {
6608
6660
  } from "@ai-sdk/provider-utils";
6609
6661
 
6610
6662
  // src/speech/openai-speech-options.ts
6611
- import { lazySchema as lazySchema23, zodSchema as zodSchema23 } from "@ai-sdk/provider-utils";
6663
+ import {
6664
+ lazySchema as lazySchema23,
6665
+ zodSchema as zodSchema23
6666
+ } from "@ai-sdk/provider-utils";
6612
6667
  import { z as z25 } from "zod/v4";
6613
6668
  var openaiSpeechModelOptionsSchema = lazySchema23(
6614
6669
  () => zodSchema23(
@@ -6732,7 +6787,7 @@ var OpenAISpeechModel = class _OpenAISpeechModel {
6732
6787
  // src/transcription/openai-transcription-model.ts
6733
6788
  import {
6734
6789
  combineHeaders as combineHeaders8,
6735
- convertBase64ToUint8Array as convertBase64ToUint8Array3,
6790
+ convertBase64ToUint8Array as convertBase64ToUint8Array2,
6736
6791
  createJsonResponseHandler as createJsonResponseHandler7,
6737
6792
  mediaTypeToExtension,
6738
6793
  parseProviderOptions as parseProviderOptions8,
@@ -6777,7 +6832,10 @@ var openaiTranscriptionResponseSchema = lazySchema24(
6777
6832
  );
6778
6833
 
6779
6834
  // src/transcription/openai-transcription-options.ts
6780
- import { lazySchema as lazySchema25, zodSchema as zodSchema25 } from "@ai-sdk/provider-utils";
6835
+ import {
6836
+ lazySchema as lazySchema25,
6837
+ zodSchema as zodSchema25
6838
+ } from "@ai-sdk/provider-utils";
6781
6839
  import { z as z27 } from "zod/v4";
6782
6840
  var openAITranscriptionModelOptions = lazySchema25(
6783
6841
  () => zodSchema25(
@@ -6898,7 +6956,7 @@ var OpenAITranscriptionModel = class _OpenAITranscriptionModel {
6898
6956
  schema: openAITranscriptionModelOptions
6899
6957
  });
6900
6958
  const formData = new FormData();
6901
- const blob = audio instanceof Uint8Array ? new Blob([audio]) : new Blob([convertBase64ToUint8Array3(audio)]);
6959
+ const blob = audio instanceof Uint8Array ? new Blob([audio]) : new Blob([convertBase64ToUint8Array2(audio)]);
6902
6960
  formData.append("model", this.modelId);
6903
6961
  const fileExtension = mediaTypeToExtension(mediaType);
6904
6962
  formData.append(
@@ -6987,7 +7045,7 @@ var OpenAITranscriptionModel = class _OpenAITranscriptionModel {
6987
7045
  // src/skills/openai-skills.ts
6988
7046
  import {
6989
7047
  combineHeaders as combineHeaders9,
6990
- convertBase64ToUint8Array as convertBase64ToUint8Array4,
7048
+ convertInlineFileDataToUint8Array as convertInlineFileDataToUint8Array2,
6991
7049
  createJsonResponseHandler as createJsonResponseHandler8,
6992
7050
  postFormDataToApi as postFormDataToApi4
6993
7051
  } from "@ai-sdk/provider-utils";
@@ -7038,7 +7096,7 @@ var OpenAISkills = class {
7038
7096
  }
7039
7097
  const formData = new FormData();
7040
7098
  for (const file of params.files) {
7041
- const content = typeof file.content === "string" ? convertBase64ToUint8Array4(file.content) : file.content;
7099
+ const content = convertInlineFileDataToUint8Array2(file.data);
7042
7100
  formData.append("files[]", new Blob([content]), file.path);
7043
7101
  }
7044
7102
  const { value: response } = await postFormDataToApi4({
@@ -7069,7 +7127,7 @@ var OpenAISkills = class {
7069
7127
  };
7070
7128
 
7071
7129
  // src/version.ts
7072
- var VERSION = true ? "4.0.0-beta.40" : "0.0.0-test";
7130
+ var VERSION = true ? "4.0.0-beta.41" : "0.0.0-test";
7073
7131
 
7074
7132
  // src/openai-provider.ts
7075
7133
  function createOpenAI(options = {}) {