@ai-sdk/anthropic
Advanced tools
+4
-4
@@ -556,3 +556,3 @@ import { JSONObject, ProviderV4, LanguageModelV4, FilesV4, SkillsV4 } from '@ai-sdk/provider'; | ||
| old_start: number | null; | ||
| }, {}, {}>>[0]) => _ai_sdk_provider_utils.ProviderExecutedTool<{ | ||
| }, {}, {}>>[0]) => _ai_sdk_provider_utils.Experimental_ToolCallerTool<_ai_sdk_provider_utils.ProviderExecutedTool<{ | ||
| type: "programmatic-tool-call"; | ||
@@ -619,3 +619,3 @@ code: string; | ||
| old_start: number | null; | ||
| }, {}>; | ||
| }, {}>>; | ||
| /** | ||
@@ -704,3 +704,3 @@ * Claude can analyze data, create visualizations, perform complex calculations, | ||
| old_start: number | null; | ||
| }, {}, {}>>[0]) => _ai_sdk_provider_utils.ProviderExecutedTool<{ | ||
| }, {}, {}>>[0]) => _ai_sdk_provider_utils.Experimental_ToolCallerTool<_ai_sdk_provider_utils.ProviderExecutedTool<{ | ||
| type: "programmatic-tool-call"; | ||
@@ -776,3 +776,3 @@ code: string; | ||
| old_start: number | null; | ||
| }, {}>; | ||
| }, {}>>; | ||
| /** | ||
@@ -779,0 +779,0 @@ * Claude can interact with computer environments through the computer use tool, which |
@@ -317,3 +317,3 @@ import { FilesV4, FilesV4UploadFileCallOptions, FilesV4UploadFileResult, LanguageModelV4, JSONObject, LanguageModelV4CallOptions, LanguageModelV4GenerateResult, LanguageModelV4StreamResult, JSONSchema7, SharedV4ProviderMetadata, SharedV4Warning, SkillsV4 } from '@ai-sdk/provider'; | ||
| old_start: number | null; | ||
| }, {}, {}>>[0]) => _ai_sdk_provider_utils.ProviderExecutedTool<{ | ||
| }, {}, {}>>[0]) => _ai_sdk_provider_utils.Experimental_ToolCallerTool<_ai_sdk_provider_utils.ProviderExecutedTool<{ | ||
| type: "programmatic-tool-call"; | ||
@@ -380,3 +380,3 @@ code: string; | ||
| old_start: number | null; | ||
| }, {}>; | ||
| }, {}>>; | ||
| /** | ||
@@ -465,3 +465,3 @@ * Claude can analyze data, create visualizations, perform complex calculations, | ||
| old_start: number | null; | ||
| }, {}, {}>>[0]) => _ai_sdk_provider_utils.ProviderExecutedTool<{ | ||
| }, {}, {}>>[0]) => _ai_sdk_provider_utils.Experimental_ToolCallerTool<_ai_sdk_provider_utils.ProviderExecutedTool<{ | ||
| type: "programmatic-tool-call"; | ||
@@ -537,3 +537,3 @@ code: string; | ||
| old_start: number | null; | ||
| }, {}>; | ||
| }, {}>>; | ||
| /** | ||
@@ -540,0 +540,0 @@ * Claude can interact with computer environments through the computer use tool, which |
+3
-3
| { | ||
| "name": "@ai-sdk/anthropic", | ||
| "version": "4.0.24", | ||
| "version": "4.0.25", | ||
| "type": "module", | ||
@@ -39,3 +39,3 @@ "license": "Apache-2.0", | ||
| "@ai-sdk/provider": "4.0.4", | ||
| "@ai-sdk/provider-utils": "5.0.15" | ||
| "@ai-sdk/provider-utils": "5.0.16" | ||
| }, | ||
@@ -47,3 +47,3 @@ "devDependencies": { | ||
| "zod": "3.25.76", | ||
| "@ai-sdk/test-server": "2.0.0", | ||
| "@ai-sdk/test-server": "2.0.1", | ||
| "@vercel/ai-tsconfig": "0.0.0" | ||
@@ -50,0 +50,0 @@ }, |
| import type { JSONSchema7, JSONSchema7Definition } from '@ai-sdk/provider'; | ||
| import { isRecord } from '@ai-sdk/provider-utils'; | ||
@@ -47,3 +48,3 @@ const SUPPORTED_STRING_FORMATS = new Set([ | ||
| ): JSONSchema7Definition { | ||
| if (typeof definition === 'boolean' || !isPlainObject(definition)) { | ||
| if (typeof definition === 'boolean' || !isRecord(definition)) { | ||
| return definition; | ||
@@ -201,5 +202,1 @@ } | ||
| } | ||
| function isPlainObject(value: unknown): value is Record<string, unknown> { | ||
| return typeof value === 'object' && value !== null && !Array.isArray(value); | ||
| } |
| import { | ||
| createProviderExecutedToolFactory, | ||
| experimental_toolCaller, | ||
| lazySchema, | ||
@@ -280,3 +281,27 @@ zodSchema, | ||
| ) => { | ||
| return factory(args); | ||
| return experimental_toolCaller(factory(args), { | ||
| type: 'provider', | ||
| prepareProviderOptions: providerOptions => { | ||
| const anthropicOptions = providerOptions?.anthropic as | ||
| | { | ||
| allowedCallers?: Array< | ||
| 'direct' | 'code_execution_20250825' | 'code_execution_20260120' | ||
| >; | ||
| } | ||
| | undefined; | ||
| return { | ||
| ...providerOptions, | ||
| anthropic: { | ||
| ...anthropicOptions, | ||
| allowedCallers: [ | ||
| ...new Set([ | ||
| ...(anthropicOptions?.allowedCallers ?? []), | ||
| 'code_execution_20250825' as const, | ||
| ]), | ||
| ], | ||
| }, | ||
| }; | ||
| }, | ||
| }); | ||
| }; |
| import { | ||
| createProviderExecutedToolFactory, | ||
| experimental_toolCaller, | ||
| lazySchema, | ||
@@ -314,3 +315,27 @@ zodSchema, | ||
| ) => { | ||
| return factory(args); | ||
| return experimental_toolCaller(factory(args), { | ||
| type: 'provider', | ||
| prepareProviderOptions: providerOptions => { | ||
| const anthropicOptions = providerOptions?.anthropic as | ||
| | { | ||
| allowedCallers?: Array< | ||
| 'direct' | 'code_execution_20250825' | 'code_execution_20260120' | ||
| >; | ||
| } | ||
| | undefined; | ||
| return { | ||
| ...providerOptions, | ||
| anthropic: { | ||
| ...anthropicOptions, | ||
| allowedCallers: [ | ||
| ...new Set([ | ||
| ...(anthropicOptions?.allowedCallers ?? []), | ||
| 'code_execution_20260120' as const, | ||
| ]), | ||
| ], | ||
| }, | ||
| }; | ||
| }, | ||
| }); | ||
| }; |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
2027814
0.39%25303
0.47%+ Added
- Removed