@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/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 +1 -1
- package/src/convert-to-anthropic-messages-prompt.ts +17 -0
package/package.json
CHANGED
|
@@ -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',
|