@fairyhunter13/ai-anthropic 3.0.58-fork.21 → 3.0.58-fork.22

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fairyhunter13/ai-anthropic",
3
- "version": "3.0.58-fork.21",
3
+ "version": "3.0.58-fork.22",
4
4
  "license": "Apache-2.0",
5
5
  "sideEffects": false,
6
6
  "main": "./dist/index.js",
@@ -976,6 +976,23 @@ export async function convertToAnthropicMessagesPrompt({
976
976
  if (providerToolName === 'web_search') {
977
977
  const output = part.output;
978
978
 
979
+ if (
980
+ output.type === 'error-text' ||
981
+ output.type === 'error-json'
982
+ ) {
983
+ anthropicContent.push({
984
+ type: 'web_search_tool_result',
985
+ tool_use_id: part.toolCallId,
986
+ content: {
987
+ type: 'web_search_tool_result_error',
988
+ error_code: 'unavailable',
989
+ },
990
+ cache_control: cacheControl,
991
+ });
992
+
993
+ break;
994
+ }
995
+
979
996
  if (output.type !== 'json') {
980
997
  warnings.push({
981
998
  type: 'other',