@ai-sdk/anthropic 3.0.93 → 3.0.94
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 +9 -0
- package/dist/index.js +11 -5
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +16 -8
- package/dist/index.mjs.map +1 -1
- package/dist/internal/index.js +2 -2
- package/dist/internal/index.js.map +1 -1
- package/dist/internal/index.mjs +7 -5
- package/dist/internal/index.mjs.map +1 -1
- package/package.json +2 -2
- package/src/anthropic-messages-language-model.ts +2 -1
- package/src/anthropic-provider.ts +13 -2
- package/src/convert-to-anthropic-messages-prompt.ts +3 -2
package/dist/internal/index.js
CHANGED
|
@@ -2699,7 +2699,7 @@ async function convertToAnthropicMessagesPrompt({
|
|
|
2699
2699
|
let errorInfo = {};
|
|
2700
2700
|
try {
|
|
2701
2701
|
if (typeof output.value === "string") {
|
|
2702
|
-
errorInfo =
|
|
2702
|
+
errorInfo = (0, import_provider_utils14.secureJsonParse)(output.value);
|
|
2703
2703
|
} else if (typeof output.value === "object" && output.value !== null) {
|
|
2704
2704
|
errorInfo = output.value;
|
|
2705
2705
|
}
|
|
@@ -4807,7 +4807,7 @@ var AnthropicMessagesLanguageModel = class {
|
|
|
4807
4807
|
let finalInput = contentBlock.input === "" ? "{}" : contentBlock.input;
|
|
4808
4808
|
if (contentBlock.providerToolName === "code_execution") {
|
|
4809
4809
|
try {
|
|
4810
|
-
const parsed =
|
|
4810
|
+
const parsed = (0, import_provider_utils15.secureJsonParse)(finalInput);
|
|
4811
4811
|
if (parsed != null && typeof parsed === "object" && "code" in parsed && !("type" in parsed)) {
|
|
4812
4812
|
finalInput = JSON.stringify({
|
|
4813
4813
|
type: "programmatic-tool-call",
|