@ai-sdk/openai 2.0.8 → 2.0.9

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,11 @@
1
1
  # @ai-sdk/openai
2
2
 
3
+ ## 2.0.9
4
+
5
+ ### Patch Changes
6
+
7
+ - 8f8a521: fix(providers): use convertToBase64 for Uint8Array image parts to produce valid data URLs; keep mediaType normalization and URL passthrough
8
+
3
9
  ## 2.0.8
4
10
 
5
11
  ### Patch Changes
package/dist/index.js CHANGED
@@ -2002,7 +2002,7 @@ async function convertToOpenAIResponsesMessages({
2002
2002
  return {
2003
2003
  type: "input_image",
2004
2004
  ...part.data instanceof URL ? { image_url: part.data.toString() } : typeof part.data === "string" && part.data.startsWith("file-") ? { file_id: part.data } : {
2005
- image_url: `data:${mediaType};base64,${part.data}`
2005
+ image_url: `data:${mediaType};base64,${(0, import_provider_utils11.convertToBase64)(part.data)}`
2006
2006
  },
2007
2007
  detail: (_b2 = (_a2 = part.providerOptions) == null ? void 0 : _a2.openai) == null ? void 0 : _b2.imageDetail
2008
2008
  };