@ai-sdk/anthropic 3.0.57 → 3.0.59

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": "@ai-sdk/anthropic",
3
- "version": "3.0.57",
3
+ "version": "3.0.59",
4
4
  "license": "Apache-2.0",
5
5
  "sideEffects": false,
6
6
  "main": "./dist/index.js",
@@ -37,7 +37,7 @@
37
37
  },
38
38
  "dependencies": {
39
39
  "@ai-sdk/provider": "3.0.8",
40
- "@ai-sdk/provider-utils": "4.0.18"
40
+ "@ai-sdk/provider-utils": "4.0.20"
41
41
  },
42
42
  "devDependencies": {
43
43
  "@types/node": "20.17.24",
@@ -352,6 +352,7 @@ export type AnthropicTool =
352
352
  description: string | undefined;
353
353
  input_schema: JSONSchema7;
354
354
  cache_control: AnthropicCacheControl | undefined;
355
+ eager_input_streaming?: boolean;
355
356
  strict?: boolean;
356
357
  /**
357
358
  * When true, this tool is deferred and will only be loaded when
@@ -17,6 +17,7 @@ export interface AnthropicToolOptions {
17
17
  allowedCallers?: Array<
18
18
  'direct' | 'code_execution_20250825' | 'code_execution_20260120'
19
19
  >;
20
+ eagerInputStreaming?: boolean;
20
21
  }
21
22
 
22
23
  export async function prepareTools({
@@ -66,6 +67,8 @@ export async function prepareTools({
66
67
  const anthropicOptions = tool.providerOptions?.anthropic as
67
68
  | AnthropicToolOptions
68
69
  | undefined;
70
+ // eager_input_streaming is only supported on custom (function) tools
71
+ const eagerInputStreaming = anthropicOptions?.eagerInputStreaming;
69
72
  const deferLoading = anthropicOptions?.deferLoading;
70
73
  const allowedCallers = anthropicOptions?.allowedCallers;
71
74
 
@@ -74,6 +77,7 @@ export async function prepareTools({
74
77
  description: tool.description,
75
78
  input_schema: tool.inputSchema,
76
79
  cache_control: cacheControl,
80
+ ...(eagerInputStreaming ? { eager_input_streaming: true } : {}),
77
81
  ...(supportsStructuredOutput === true && tool.strict != null
78
82
  ? { strict: tool.strict }
79
83
  : {}),