@ai-sdk/anthropic
Advanced tools
+6
-0
| # @ai-sdk/anthropic | ||
| ## 2.0.63 | ||
| ### Patch Changes | ||
| - e551c84: fix(anthropic): map proper context management tools for anthropic | ||
| ## 2.0.62 | ||
@@ -4,0 +10,0 @@ |
+52
-6
@@ -73,15 +73,46 @@ import { JSONObject, ProviderV2, LanguageModelV2 } from '@ai-sdk/provider'; | ||
| * List of context management edits that were applied. | ||
| * Each item in the array is a specific type of context management edit. | ||
| */ | ||
| appliedEdits: Array<{ | ||
| appliedEdits: Array< | ||
| /** | ||
| * Represents an edit where a certain number of tool uses and input tokens were cleared. | ||
| */ | ||
| { | ||
| /** | ||
| * The type of context management edit applied. | ||
| * Possible value: 'clear_01' | ||
| * Possible value: 'clear_tool_uses_20250919' | ||
| */ | ||
| type: 'clear_01'; | ||
| type: 'clear_tool_uses_20250919'; | ||
| /** | ||
| * The number of input tokens that were cleared. | ||
| * Number of tool uses that were cleared by this edit. | ||
| * Minimum: 0 | ||
| */ | ||
| clearedToolUses: number; | ||
| /** | ||
| * Number of input tokens cleared by this edit. | ||
| * Minimum: 0 | ||
| */ | ||
| clearedInputTokens: number; | ||
| } | ||
| /** | ||
| * Represents an edit where a certain number of thinking turns and input tokens were cleared. | ||
| */ | ||
| | { | ||
| /** | ||
| * The type of context management edit applied. | ||
| * Possible value: 'clear_thinking_20251015' | ||
| */ | ||
| type: 'clear_thinking_20251015'; | ||
| /** | ||
| * Number of thinking turns that were cleared by this edit. | ||
| * Minimum: 0 | ||
| */ | ||
| clearedThinkingTurns: number; | ||
| /** | ||
| * Number of input tokens cleared by this edit. | ||
| * Minimum: 0 | ||
| */ | ||
| clearedInputTokens: number; | ||
| } | ||
| /** | ||
| * Represents a compaction edit where the conversation context was summarized. | ||
@@ -137,7 +168,22 @@ */ | ||
| edits: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{ | ||
| type: z.ZodLiteral<"clear_01">; | ||
| trigger: z.ZodOptional<z.ZodObject<{ | ||
| type: z.ZodLiteral<"clear_tool_uses_20250919">; | ||
| trigger: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{ | ||
| type: z.ZodLiteral<"input_tokens">; | ||
| value: z.ZodNumber; | ||
| }, z.core.$strip>, z.ZodObject<{ | ||
| type: z.ZodLiteral<"tool_uses">; | ||
| value: z.ZodNumber; | ||
| }, z.core.$strip>]>>; | ||
| keep: z.ZodOptional<z.ZodObject<{ | ||
| type: z.ZodLiteral<"tool_uses">; | ||
| value: z.ZodNumber; | ||
| }, z.core.$strip>>; | ||
| clearAtLeast: z.ZodOptional<z.ZodObject<{ | ||
| type: z.ZodLiteral<"input_tokens">; | ||
| value: z.ZodNumber; | ||
| }, z.core.$strip>>; | ||
| clearToolInputs: z.ZodOptional<z.ZodBoolean>; | ||
| excludeTools: z.ZodOptional<z.ZodArray<z.ZodString>>; | ||
| }, z.core.$strip>, z.ZodObject<{ | ||
| type: z.ZodLiteral<"clear_thinking_20251015">; | ||
| keep: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"all">, z.ZodObject<{ | ||
@@ -144,0 +190,0 @@ type: z.ZodLiteral<"thinking_turns">; |
+52
-6
@@ -73,15 +73,46 @@ import { JSONObject, ProviderV2, LanguageModelV2 } from '@ai-sdk/provider'; | ||
| * List of context management edits that were applied. | ||
| * Each item in the array is a specific type of context management edit. | ||
| */ | ||
| appliedEdits: Array<{ | ||
| appliedEdits: Array< | ||
| /** | ||
| * Represents an edit where a certain number of tool uses and input tokens were cleared. | ||
| */ | ||
| { | ||
| /** | ||
| * The type of context management edit applied. | ||
| * Possible value: 'clear_01' | ||
| * Possible value: 'clear_tool_uses_20250919' | ||
| */ | ||
| type: 'clear_01'; | ||
| type: 'clear_tool_uses_20250919'; | ||
| /** | ||
| * The number of input tokens that were cleared. | ||
| * Number of tool uses that were cleared by this edit. | ||
| * Minimum: 0 | ||
| */ | ||
| clearedToolUses: number; | ||
| /** | ||
| * Number of input tokens cleared by this edit. | ||
| * Minimum: 0 | ||
| */ | ||
| clearedInputTokens: number; | ||
| } | ||
| /** | ||
| * Represents an edit where a certain number of thinking turns and input tokens were cleared. | ||
| */ | ||
| | { | ||
| /** | ||
| * The type of context management edit applied. | ||
| * Possible value: 'clear_thinking_20251015' | ||
| */ | ||
| type: 'clear_thinking_20251015'; | ||
| /** | ||
| * Number of thinking turns that were cleared by this edit. | ||
| * Minimum: 0 | ||
| */ | ||
| clearedThinkingTurns: number; | ||
| /** | ||
| * Number of input tokens cleared by this edit. | ||
| * Minimum: 0 | ||
| */ | ||
| clearedInputTokens: number; | ||
| } | ||
| /** | ||
| * Represents a compaction edit where the conversation context was summarized. | ||
@@ -137,7 +168,22 @@ */ | ||
| edits: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{ | ||
| type: z.ZodLiteral<"clear_01">; | ||
| trigger: z.ZodOptional<z.ZodObject<{ | ||
| type: z.ZodLiteral<"clear_tool_uses_20250919">; | ||
| trigger: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{ | ||
| type: z.ZodLiteral<"input_tokens">; | ||
| value: z.ZodNumber; | ||
| }, z.core.$strip>, z.ZodObject<{ | ||
| type: z.ZodLiteral<"tool_uses">; | ||
| value: z.ZodNumber; | ||
| }, z.core.$strip>]>>; | ||
| keep: z.ZodOptional<z.ZodObject<{ | ||
| type: z.ZodLiteral<"tool_uses">; | ||
| value: z.ZodNumber; | ||
| }, z.core.$strip>>; | ||
| clearAtLeast: z.ZodOptional<z.ZodObject<{ | ||
| type: z.ZodLiteral<"input_tokens">; | ||
| value: z.ZodNumber; | ||
| }, z.core.$strip>>; | ||
| clearToolInputs: z.ZodOptional<z.ZodBoolean>; | ||
| excludeTools: z.ZodOptional<z.ZodArray<z.ZodString>>; | ||
| }, z.core.$strip>, z.ZodObject<{ | ||
| type: z.ZodLiteral<"clear_thinking_20251015">; | ||
| keep: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"all">, z.ZodObject<{ | ||
@@ -144,0 +190,0 @@ type: z.ZodLiteral<"thinking_turns">; |
+3
-3
| { | ||
| "name": "@ai-sdk/anthropic", | ||
| "version": "2.0.62", | ||
| "version": "2.0.63", | ||
| "license": "Apache-2.0", | ||
@@ -37,4 +37,4 @@ "sideEffects": false, | ||
| "zod": "3.25.76", | ||
| "@ai-sdk/test-server": "0.0.2", | ||
| "@vercel/ai-tsconfig": "0.0.0" | ||
| "@vercel/ai-tsconfig": "0.0.0", | ||
| "@ai-sdk/test-server": "0.0.2" | ||
| }, | ||
@@ -41,0 +41,0 @@ "peerDependencies": { |
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
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
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
1711792
2.4%15732
1.75%