@ai-sdk/langchain 2.0.228 → 2.0.230

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,28 @@
1
1
  # @ai-sdk/langchain
2
2
 
3
+ ## 2.0.230
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [e1af05f]
8
+ - ai@6.0.222
9
+
10
+ ## 2.0.229
11
+
12
+ ### Patch Changes
13
+
14
+ - c8e38eb: fix(langchain): reset streamEvents text between model invocations
15
+ - ea6eb0a: fix(langchain): register key mapping for tool calls emitted via messages mode for HITL interrupt matching
16
+ - Updated dependencies [2958540]
17
+ - Updated dependencies [aa2dbe6]
18
+ - Updated dependencies [faaef7c]
19
+ - Updated dependencies [45a9cbf]
20
+ - Updated dependencies [2706461]
21
+ - Updated dependencies [327642b]
22
+ - Updated dependencies [89df298]
23
+ - Updated dependencies [8ed1f83]
24
+ - ai@6.0.221
25
+
3
26
  ## 2.0.228
4
27
 
5
28
  ### Patch Changes
package/dist/index.js CHANGED
@@ -863,6 +863,9 @@ function processLangGraphEvent(event, state, controller) {
863
863
  input: toolCall.args,
864
864
  dynamic: true
865
865
  });
866
+ } else if (toolCall.id && emittedToolCalls.has(toolCall.id)) {
867
+ const toolCallKey = `${toolCall.name}:${JSON.stringify(toolCall.args)}`;
868
+ emittedToolCallsByKey.set(toolCallKey, toolCall.id);
866
869
  }
867
870
  }
868
871
  }
@@ -987,6 +990,22 @@ function processStreamEventsEvent(event, state, controller) {
987
990
  if (!event.data) return;
988
991
  switch (event.event) {
989
992
  case "on_chat_model_start": {
993
+ if (state.reasoningStarted) {
994
+ controller.enqueue({
995
+ type: "reasoning-end",
996
+ id: state.reasoningMessageId != null ? state.reasoningMessageId : state.messageId
997
+ });
998
+ state.reasoningStarted = false;
999
+ state.reasoningMessageId = null;
1000
+ }
1001
+ if (state.textStarted) {
1002
+ controller.enqueue({
1003
+ type: "text-end",
1004
+ id: state.textMessageId != null ? state.textMessageId : state.messageId
1005
+ });
1006
+ state.textStarted = false;
1007
+ state.textMessageId = null;
1008
+ }
990
1009
  const runId = event.run_id || event.data.run_id;
991
1010
  if (runId) {
992
1011
  state.messageId = runId;