@ai-sdk/langchain 2.0.320 → 2.0.321

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/dist/index.mjs CHANGED
@@ -13,7 +13,10 @@ import {
13
13
  ToolMessage,
14
14
  AIMessageChunk
15
15
  } from "@langchain/core/messages";
16
- import { convertUint8ArrayToBase64 } from "@ai-sdk/provider-utils";
16
+ import {
17
+ convertUint8ArrayToBase64,
18
+ secureJsonParse
19
+ } from "@ai-sdk/provider-utils";
17
20
  function parseLangGraphEvent(event) {
18
21
  return event.length === 3 ? [event[0], event[1], event[2]] : [void 0, event[0], event[1]];
19
22
  }
@@ -995,7 +998,7 @@ function processLangGraphEvent(event, state, controller) {
995
998
  const functionData = tc.function;
996
999
  let args;
997
1000
  try {
998
- args = (functionData == null ? void 0 : functionData.arguments) ? JSON.parse(functionData.arguments) : {};
1001
+ args = (functionData == null ? void 0 : functionData.arguments) ? secureJsonParse(functionData.arguments) : {};
999
1002
  } catch (e) {
1000
1003
  args = {};
1001
1004
  }