@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.
@@ -2114,6 +2114,19 @@ async function convertToAnthropicMessagesPrompt({
2114
2114
  }
2115
2115
  if (providerToolName === "web_fetch") {
2116
2116
  const output = part.output;
2117
+ if (output.type === "error-json") {
2118
+ const errorValue = JSON.parse(output.value);
2119
+ anthropicContent.push({
2120
+ type: "web_fetch_tool_result",
2121
+ tool_use_id: part.toolCallId,
2122
+ content: {
2123
+ type: "web_fetch_tool_result_error",
2124
+ error_code: errorValue.errorCode
2125
+ },
2126
+ cache_control: cacheControl
2127
+ });
2128
+ break;
2129
+ }
2117
2130
  if (output.type !== "json") {
2118
2131
  warnings.push({
2119
2132
  type: "other",