@ai-sdk/anthropic 2.0.12 → 2.0.13
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 +8 -0
- package/dist/index.js +8 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +8 -1
- package/dist/index.mjs.map +1 -1
- package/dist/internal/index.js +8 -1
- package/dist/internal/index.js.map +1 -1
- package/dist/internal/index.mjs +8 -1
- package/dist/internal/index.mjs.map +1 -1
- package/package.json +3 -3
package/dist/index.mjs
CHANGED
|
@@ -554,7 +554,14 @@ async function convertToAnthropicMessagesPrompt({
|
|
|
554
554
|
}
|
|
555
555
|
}
|
|
556
556
|
}
|
|
557
|
-
|
|
557
|
+
const toolResultParts = anthropicContent.filter(
|
|
558
|
+
(part) => part.type === "tool_result"
|
|
559
|
+
);
|
|
560
|
+
const otherParts = anthropicContent.filter(
|
|
561
|
+
(part) => part.type !== "tool_result"
|
|
562
|
+
);
|
|
563
|
+
const reorderedContent = toolResultParts.length > 0 ? [...toolResultParts, ...otherParts] : anthropicContent;
|
|
564
|
+
messages.push({ role: "user", content: reorderedContent });
|
|
558
565
|
break;
|
|
559
566
|
}
|
|
560
567
|
case "assistant": {
|