ai 7.0.133 → 7.0.134
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 +7 -0
- package/dist/index.js +8 -8
- package/dist/index.js.map +1 -1
- package/dist/internal/index.js +1 -1
- package/package.json +3 -3
- package/src/ui/chat.ts +28 -29
package/dist/internal/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ai",
|
|
3
|
-
"version": "7.0.
|
|
3
|
+
"version": "7.0.134",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "AI SDK by Vercel - build apps like ChatGPT, Claude, Gemini, and more with a single interface for any model using the Vercel AI Gateway or go direct to OpenAI, Anthropic, Google, or any other model provider.",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -47,13 +47,13 @@
|
|
|
47
47
|
"@ai-sdk/provider-utils": "5.0.57"
|
|
48
48
|
},
|
|
49
49
|
"devDependencies": {
|
|
50
|
-
"@ai-sdk/amazon-bedrock": "5.0.
|
|
50
|
+
"@ai-sdk/amazon-bedrock": "5.0.112",
|
|
51
51
|
"@ai-sdk/deepseek": "3.0.62",
|
|
52
52
|
"@ai-sdk/google": "4.0.92",
|
|
53
53
|
"@ai-sdk/groq": "4.0.58",
|
|
54
54
|
"@ai-sdk/huggingface": "2.0.66",
|
|
55
55
|
"@ai-sdk/moonshotai": "3.0.66",
|
|
56
|
-
"@ai-sdk/openai": "4.0.
|
|
56
|
+
"@ai-sdk/openai": "4.0.90",
|
|
57
57
|
"@ai-sdk/test-server": "2.0.4",
|
|
58
58
|
"@ai-sdk/xai": "5.0.19",
|
|
59
59
|
"@edge-runtime/vm": "^5.0.0",
|
package/src/ui/chat.ts
CHANGED
|
@@ -595,21 +595,21 @@ export abstract class AbstractChat<UI_MESSAGE extends UIMessage> {
|
|
|
595
595
|
this.status !== 'submitted' &&
|
|
596
596
|
this.sendAutomaticallyWhen
|
|
597
597
|
) {
|
|
598
|
-
this.shouldSendAutomatically()
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
}
|
|
612
|
-
}
|
|
598
|
+
const shouldSend = await this.shouldSendAutomatically();
|
|
599
|
+
|
|
600
|
+
if (shouldSend) {
|
|
601
|
+
// no await to avoid deadlocking
|
|
602
|
+
const messageId =
|
|
603
|
+
messageIndex === -1
|
|
604
|
+
? this.lastMessage?.id
|
|
605
|
+
: messages[messageIndex].id;
|
|
606
|
+
|
|
607
|
+
this.makeRequestForToolApproval({
|
|
608
|
+
messageId,
|
|
609
|
+
messageIndex,
|
|
610
|
+
...options,
|
|
611
|
+
});
|
|
612
|
+
}
|
|
613
613
|
}
|
|
614
614
|
});
|
|
615
615
|
|
|
@@ -680,16 +680,16 @@ export abstract class AbstractChat<UI_MESSAGE extends UIMessage> {
|
|
|
680
680
|
this.status !== 'submitted' &&
|
|
681
681
|
this.sendAutomaticallyWhen
|
|
682
682
|
) {
|
|
683
|
-
this.shouldSendAutomatically()
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
}
|
|
692
|
-
}
|
|
683
|
+
const shouldSend = await this.shouldSendAutomatically();
|
|
684
|
+
|
|
685
|
+
if (shouldSend) {
|
|
686
|
+
// no await to avoid deadlocking
|
|
687
|
+
this.makeRequest({
|
|
688
|
+
trigger: 'submit-message',
|
|
689
|
+
messageId: this.lastMessage?.id,
|
|
690
|
+
...options,
|
|
691
|
+
});
|
|
692
|
+
}
|
|
693
693
|
}
|
|
694
694
|
});
|
|
695
695
|
|
|
@@ -854,10 +854,8 @@ export abstract class AbstractChat<UI_MESSAGE extends UIMessage> {
|
|
|
854
854
|
responseMessageIndex === -1
|
|
855
855
|
? lastMessage
|
|
856
856
|
: this.state.messages[responseMessageIndex];
|
|
857
|
-
//
|
|
858
|
-
//
|
|
859
|
-
// 2) or the result of an answered tool approval request
|
|
860
|
-
// Keep the tool part so in case 2, those chunks can find their tool call
|
|
857
|
+
// The continued stream can start with input deltas or a tool result.
|
|
858
|
+
// Keep unfinished tool parts so result chunks can find their tool call.
|
|
861
859
|
const resumableResponseMessage =
|
|
862
860
|
trigger === 'resume-stream' &&
|
|
863
861
|
responseMessage?.role === 'assistant' &&
|
|
@@ -865,6 +863,7 @@ export abstract class AbstractChat<UI_MESSAGE extends UIMessage> {
|
|
|
865
863
|
part =>
|
|
866
864
|
isToolUIPart(part) &&
|
|
867
865
|
(part.state === 'input-streaming' ||
|
|
866
|
+
(part.state === 'input-available' && part.providerExecuted) ||
|
|
868
867
|
part.state === 'approval-responded'),
|
|
869
868
|
)
|
|
870
869
|
? this.state.snapshot(responseMessage)
|