@ai-sdk/workflow 1.0.31 → 1.0.32
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 +20 -12
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
- package/src/stream-text-iterator.ts +26 -15
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
# @ai-sdk/workflow
|
|
2
2
|
|
|
3
|
+
## 1.0.32
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- a50b88a: fix(workflow): preserve assistant text in tool-call conversation messages
|
|
8
|
+
- Updated dependencies [6cd7c74]
|
|
9
|
+
- Updated dependencies [e35bcae]
|
|
10
|
+
- Updated dependencies [a4eb3f3]
|
|
11
|
+
- ai@7.0.32
|
|
12
|
+
|
|
3
13
|
## 1.0.31
|
|
4
14
|
|
|
5
15
|
### Patch Changes
|
package/dist/index.js
CHANGED
|
@@ -508,20 +508,28 @@ async function* streamTextIterator({
|
|
|
508
508
|
const finishReason = finish == null ? void 0 : finish.finishReason;
|
|
509
509
|
if (finishReason === "tool-calls") {
|
|
510
510
|
lastStepWasToolCalls = true;
|
|
511
|
+
const textContent = step.content.filter(
|
|
512
|
+
(item) => item.type === "text"
|
|
513
|
+
);
|
|
511
514
|
conversationPrompt.push({
|
|
512
515
|
role: "assistant",
|
|
513
|
-
content:
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
516
|
+
content: [
|
|
517
|
+
...textContent,
|
|
518
|
+
...toolCalls.map((toolCall) => {
|
|
519
|
+
const sanitizedMetadata = sanitizeProviderMetadataForToolCall(
|
|
520
|
+
toolCall.providerMetadata
|
|
521
|
+
);
|
|
522
|
+
return {
|
|
523
|
+
type: "tool-call",
|
|
524
|
+
toolCallId: toolCall.toolCallId,
|
|
525
|
+
toolName: toolCall.toolName,
|
|
526
|
+
input: toolCall.input,
|
|
527
|
+
...sanitizedMetadata != null ? {
|
|
528
|
+
providerOptions: sanitizedMetadata
|
|
529
|
+
} : {}
|
|
530
|
+
};
|
|
531
|
+
})
|
|
532
|
+
]
|
|
525
533
|
});
|
|
526
534
|
const toolResults = yield {
|
|
527
535
|
toolCalls,
|