@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/CHANGELOG.md +10 -0
- package/dist/index.js +3 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +3 -2
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -3
- package/src/utils.ts +3 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
# @ai-sdk/langchain
|
|
2
2
|
|
|
3
|
+
## 2.0.320
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 26f647b: fix(langchain): avoid `RangeError: Maximum call stack size exceeded` when converting large binary image and file parts
|
|
8
|
+
- Updated dependencies [1183cc4]
|
|
9
|
+
- Updated dependencies [d726591]
|
|
10
|
+
- @ai-sdk/provider-utils@4.0.62
|
|
11
|
+
- ai@6.0.312
|
|
12
|
+
|
|
3
13
|
## 2.0.319
|
|
4
14
|
|
|
5
15
|
### Patch Changes
|
package/dist/index.js
CHANGED
|
@@ -33,6 +33,7 @@ var import_ai = require("ai");
|
|
|
33
33
|
|
|
34
34
|
// src/utils.ts
|
|
35
35
|
var import_messages = require("@langchain/core/messages");
|
|
36
|
+
var import_provider_utils = require("@ai-sdk/provider-utils");
|
|
36
37
|
function parseLangGraphEvent(event) {
|
|
37
38
|
return event.length === 3 ? [event[0], event[1], event[2]] : [void 0, event[0], event[1]];
|
|
38
39
|
}
|
|
@@ -182,7 +183,7 @@ function convertImageToContentBlock(data, mediaType = "image/png") {
|
|
|
182
183
|
const bytes = data instanceof ArrayBuffer ? new Uint8Array(data) : data;
|
|
183
184
|
return {
|
|
184
185
|
type: "image",
|
|
185
|
-
data:
|
|
186
|
+
data: (0, import_provider_utils.convertUint8ArrayToBase64)(bytes),
|
|
186
187
|
mimeType: mediaType
|
|
187
188
|
};
|
|
188
189
|
}
|
|
@@ -253,7 +254,7 @@ function convertUserContent(content) {
|
|
|
253
254
|
}
|
|
254
255
|
} else if (filePart.data instanceof Uint8Array || filePart.data instanceof ArrayBuffer) {
|
|
255
256
|
const bytes = filePart.data instanceof ArrayBuffer ? new Uint8Array(filePart.data) : filePart.data;
|
|
256
|
-
const base64 =
|
|
257
|
+
const base64 = (0, import_provider_utils.convertUint8ArrayToBase64)(bytes);
|
|
257
258
|
contentBlocks.push({
|
|
258
259
|
type: "file",
|
|
259
260
|
data: base64,
|