@ai-sdk/langchain 2.0.319 → 2.0.320

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ai-sdk/langchain",
3
- "version": "2.0.319",
3
+ "version": "2.0.320",
4
4
  "license": "Apache-2.0",
5
5
  "sideEffects": false,
6
6
  "main": "./dist/index.js",
@@ -25,7 +25,8 @@
25
25
  }
26
26
  },
27
27
  "dependencies": {
28
- "ai": "6.0.311"
28
+ "@ai-sdk/provider-utils": "4.0.62",
29
+ "ai": "6.0.312"
29
30
  },
30
31
  "devDependencies": {
31
32
  "@langchain/core": "^1.1.5",
@@ -33,7 +34,6 @@
33
34
  "@types/node": "20.17.24",
34
35
  "tsup": "^8",
35
36
  "typescript": "5.8.3",
36
- "@ai-sdk/provider-utils": "4.0.61",
37
37
  "@vercel/ai-tsconfig": "0.0.0"
38
38
  },
39
39
  "peerDependencies": {
package/src/utils.ts CHANGED
@@ -17,6 +17,7 @@ import {
17
17
  type ProviderMetadata,
18
18
  type JSONValue,
19
19
  } from 'ai';
20
+ import { convertUint8ArrayToBase64 } from '@ai-sdk/provider-utils';
20
21
 
21
22
  import {
22
23
  type LangGraphEventState,
@@ -246,7 +247,7 @@ function convertImageToContentBlock(
246
247
  const bytes = data instanceof ArrayBuffer ? new Uint8Array(data) : data;
247
248
  return {
248
249
  type: 'image',
249
- data: btoa(String.fromCharCode(...bytes)),
250
+ data: convertUint8ArrayToBase64(bytes),
250
251
  mimeType: mediaType,
251
252
  };
252
253
  }
@@ -353,7 +354,7 @@ export function convertUserContent(content: UserContent): HumanMessage {
353
354
  filePart.data instanceof ArrayBuffer
354
355
  ? new Uint8Array(filePart.data)
355
356
  : filePart.data;
356
- const base64 = btoa(String.fromCharCode(...bytes));
357
+ const base64 = convertUint8ArrayToBase64(bytes);
357
358
  contentBlocks.push({
358
359
  type: 'file',
359
360
  data: base64,