@fairyhunter13/ai-anthropic 3.0.58-fork.21 → 3.0.58-fork.23
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/dist/index.js +12 -0
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +12 -0
- package/dist/index.mjs.map +1 -1
- package/dist/internal/index.js +12 -0
- package/dist/internal/index.js.map +1 -1
- package/dist/internal/index.mjs +12 -0
- package/dist/internal/index.mjs.map +1 -1
- package/package.json +3 -5
- package/src/convert-to-anthropic-messages-prompt.ts +17 -0
package/dist/index.js
CHANGED
|
@@ -2798,6 +2798,18 @@ async function convertToAnthropicMessagesPrompt({
|
|
|
2798
2798
|
}
|
|
2799
2799
|
if (providerToolName === "web_search") {
|
|
2800
2800
|
const output = part.output;
|
|
2801
|
+
if (output.type === "error-text" || output.type === "error-json") {
|
|
2802
|
+
anthropicContent.push({
|
|
2803
|
+
type: "web_search_tool_result",
|
|
2804
|
+
tool_use_id: part.toolCallId,
|
|
2805
|
+
content: {
|
|
2806
|
+
type: "web_search_tool_result_error",
|
|
2807
|
+
error_code: "unavailable"
|
|
2808
|
+
},
|
|
2809
|
+
cache_control: cacheControl
|
|
2810
|
+
});
|
|
2811
|
+
break;
|
|
2812
|
+
}
|
|
2801
2813
|
if (output.type !== "json") {
|
|
2802
2814
|
warnings.push({
|
|
2803
2815
|
type: "other",
|