@ai-sdk/anthropic 3.0.0-beta.97 → 3.0.0
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 +167 -0
- package/dist/index.js +14 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +14 -1
- package/dist/index.mjs.map +1 -1
- package/dist/internal/index.js +13 -0
- package/dist/internal/index.js.map +1 -1
- package/dist/internal/index.mjs +13 -0
- package/dist/internal/index.mjs.map +1 -1
- package/package.json +4 -4
package/dist/internal/index.js
CHANGED
|
@@ -2098,6 +2098,19 @@ async function convertToAnthropicMessagesPrompt({
|
|
|
2098
2098
|
}
|
|
2099
2099
|
if (providerToolName === "web_fetch") {
|
|
2100
2100
|
const output = part.output;
|
|
2101
|
+
if (output.type === "error-json") {
|
|
2102
|
+
const errorValue = JSON.parse(output.value);
|
|
2103
|
+
anthropicContent.push({
|
|
2104
|
+
type: "web_fetch_tool_result",
|
|
2105
|
+
tool_use_id: part.toolCallId,
|
|
2106
|
+
content: {
|
|
2107
|
+
type: "web_fetch_tool_result_error",
|
|
2108
|
+
error_code: errorValue.errorCode
|
|
2109
|
+
},
|
|
2110
|
+
cache_control: cacheControl
|
|
2111
|
+
});
|
|
2112
|
+
break;
|
|
2113
|
+
}
|
|
2101
2114
|
if (output.type !== "json") {
|
|
2102
2115
|
warnings.push({
|
|
2103
2116
|
type: "other",
|