@ai-sdk/anthropic
Advanced tools
+4
-4
| { | ||
| "name": "@ai-sdk/anthropic", | ||
| "version": "4.0.0-canary.66", | ||
| "version": "4.0.0", | ||
| "type": "module", | ||
@@ -38,4 +38,4 @@ "license": "Apache-2.0", | ||
| "dependencies": { | ||
| "@ai-sdk/provider": "4.0.0-canary.18", | ||
| "@ai-sdk/provider-utils": "5.0.0-canary.48" | ||
| "@ai-sdk/provider": "4.0.0", | ||
| "@ai-sdk/provider-utils": "5.0.0" | ||
| }, | ||
@@ -47,3 +47,3 @@ "devDependencies": { | ||
| "zod": "3.25.76", | ||
| "@ai-sdk/test-server": "2.0.0-canary.6", | ||
| "@ai-sdk/test-server": "2.0.0", | ||
| "@vercel/ai-tsconfig": "0.0.0" | ||
@@ -50,0 +50,0 @@ }, |
@@ -1212,3 +1212,6 @@ import { | ||
| messages.push({ role: 'assistant', content: anthropicContent }); | ||
| messages.push({ | ||
| role: 'assistant', | ||
| content: moveToolUseBlocksToEnd(anthropicContent), | ||
| }); | ||
@@ -1299,1 +1302,29 @@ break; | ||
| } | ||
| function moveToolUseBlocksToEnd( | ||
| content: AnthropicAssistantMessage['content'], | ||
| ): AnthropicAssistantMessage['content'] { | ||
| const result: AnthropicAssistantMessage['content'] = []; | ||
| let segment: AnthropicAssistantMessage['content'] = []; | ||
| function flushSegment() { | ||
| result.push( | ||
| ...segment.filter(part => part.type !== 'tool_use'), | ||
| ...segment.filter(part => part.type === 'tool_use'), | ||
| ); | ||
| segment = []; | ||
| } | ||
| for (const part of content) { | ||
| if (part.type === 'thinking' || part.type === 'redacted_thinking') { | ||
| flushSegment(); | ||
| result.push(part); | ||
| } else { | ||
| segment.push(part); | ||
| } | ||
| } | ||
| flushSegment(); | ||
| return result; | ||
| } |
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
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
1949053
0.51%24488
0.3%0
-100%+ Added
+ Added
- Removed
- Removed
Updated
Updated