Skip to content

Commit

Permalink
feat (provider/anthropic): update beta flag for sonnet-3-7 when using…
Browse files Browse the repository at this point in the history
… new computer-use tool (#4995)

Co-authored-by: Eugene Zhlobo <[email protected]>
  • Loading branch information
lgrammel and ezhlobo authored Feb 26, 2025
1 parent 2fc6eca commit a4f8714
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/mighty-bobcats-move.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@ai-sdk/anthropic': patch
---

feat (provider/anthropic): update beta flag for sonnet-3-7 when using new computer-use tool
5 changes: 4 additions & 1 deletion packages/anthropic/src/anthropic-prepare-tools.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ export function prepareTools(
});
break;
case 'provider-defined':
betas.add('computer-use-2024-10-22');
switch (tool.id) {
case 'anthropic.computer_20250124':
betas.add('computer-use-2025-01-24');
anthropicTools.push({
name: tool.name,
type: 'computer_20250124',
Expand All @@ -49,6 +49,7 @@ export function prepareTools(
});
break;
case 'anthropic.computer_20241022':
betas.add('computer-use-2024-10-22');
anthropicTools.push({
name: tool.name,
type: 'computer_20241022',
Expand All @@ -58,12 +59,14 @@ export function prepareTools(
});
break;
case 'anthropic.text_editor_20241022':
betas.add('computer-use-2024-10-22');
anthropicTools.push({
name: tool.name,
type: 'text_editor_20241022',
});
break;
case 'anthropic.bash_20241022':
betas.add('computer-use-2024-10-22');
anthropicTools.push({
name: tool.name,
type: 'bash_20241022',
Expand Down

0 comments on commit a4f8714

Please sign in to comment.