@ai-sdk/anthropic 2.0.11 → 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 +15 -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/internal/index.mjs
CHANGED
|
@@ -544,7 +544,14 @@ async function convertToAnthropicMessagesPrompt({
|
|
|
544
544
|
}
|
|
545
545
|
}
|
|
546
546
|
}
|
|
547
|
-
|
|
547
|
+
const toolResultParts = anthropicContent.filter(
|
|
548
|
+
(part) => part.type === "tool_result"
|
|
549
|
+
);
|
|
550
|
+
const otherParts = anthropicContent.filter(
|
|
551
|
+
(part) => part.type !== "tool_result"
|
|
552
|
+
);
|
|
553
|
+
const reorderedContent = toolResultParts.length > 0 ? [...toolResultParts, ...otherParts] : anthropicContent;
|
|
554
|
+
messages.push({ role: "user", content: reorderedContent });
|
|
548
555
|
break;
|
|
549
556
|
}
|
|
550
557
|
case "assistant": {
|