Skip to content

feat(google-vertex): add the anthropic tool search tools#13497

Merged
aayush-kapoor merged 5 commits intomainfrom
aayush/vertex-toolsearch
Mar 17, 2026
Merged

feat(google-vertex): add the anthropic tool search tools#13497
aayush-kapoor merged 5 commits intomainfrom
aayush/vertex-toolsearch

Conversation

@aayush-kapoor
Copy link
Copy Markdown
Collaborator

@aayush-kapoor aayush-kapoor commented Mar 16, 2026

Background

#13337

We currently did not include the Tool Search tools exposed in the anthropic provider for the vertex provider.

For this change to be added, we first needed to ensure we are not passing the beta header since vertex rejects it.

Summary

include the toolSearchRegex_20251119 and toolSearchBm25_20251119 in vertexAnthropicTools

Manual Verification

verified by running the examples:

  • examples/ai-functions/src/generate-text/google/vertex-anthropic-tool-search-regex.ts
  • examples/ai-functions/src/generate-text/google/vertex-anthropic-tool-search-bm25.ts
  • examples/ai-functions/src/generate-text/google/vertex-anthropic-tool-search-deferred-bm25.ts

along with the streaming examples

Checklist

  • Tests have been added / updated (for bug fixes / features)
  • Documentation has been added / updated (for bug fixes / features)
  • A patch changeset for relevant packages has been added (for bug fixes / features - run pnpm changeset in the project root)
  • I have reviewed this pull request (self-review)

Related Issues

Fixes #13337

@tigent tigent bot added ai/provider related to a provider package. Must be assigned together with at least one `provider/*` label bug Something isn't working as documented provider/anthropic Issues related to the @ai-sdk/anthropic provider provider/google-vertex Issues related to the @ai-sdk/google-vertex provider labels Mar 16, 2026
@aayush-kapoor aayush-kapoor changed the title failiing test feat(google-vertex): add the anthropic tool search tools Mar 16, 2026
Copy link
Copy Markdown
Contributor

@vercel vercel bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Additional Suggestion:

Tests expect toolSearchRegex_20251119 and toolSearchBm25_20251119 on vertexAnthropicTools but they were never added to the object, causing test failure.

Fix on Vercel

aayush-kapoor added a commit that referenced this pull request Mar 16, 2026
## Background

The tool search tools don't require the beta header to be passed anymore
in the request ([removed from the
documentation](https://platform.claude.com/docs/en/agents-and-tools/tool-use/tool-search-tool))

it was still passed in the request with AI SDK. When passed, it is
rejected by providers such as Google Vertex (explored in PR
#13497 )

## Summary

remove the addition of the beta header `advanced-tool-use-2025-11-20` in
the prepare tools file

## Manual Verification

verified by running the existing examples before and after the fix:
-
`examples/ai-functions/src/generate-text/anthropic/tool-search-regex.ts`
-
`examples/ai-functions/src/generate-text/anthropic/tool-search-deferred-bm25.ts`
-
`examples/ai-functions/src/generate-text/anthropic/tool-search-bm25.ts`

## Checklist

- [x] Tests have been added / updated (for bug fixes / features)
- [ ] Documentation has been added / updated (for bug fixes / features)
- [x] A _patch_ changeset for relevant packages has been added (for bug
fixes / features - run `pnpm changeset` in the project root)
- [x] I have reviewed this pull request (self-review)
@aayush-kapoor aayush-kapoor added the backport Admins only: add this label to a pull request in order to backport it to the prior version label Mar 16, 2026
vercel-ai-sdk bot pushed a commit that referenced this pull request Mar 16, 2026
## Background

The tool search tools don't require the beta header to be passed anymore
in the request ([removed from the
documentation](https://platform.claude.com/docs/en/agents-and-tools/tool-use/tool-search-tool))

it was still passed in the request with AI SDK. When passed, it is
rejected by providers such as Google Vertex (explored in PR
#13497 )

## Summary

remove the addition of the beta header `advanced-tool-use-2025-11-20` in
the prepare tools file

## Manual Verification

verified by running the existing examples before and after the fix:
-
`examples/ai-functions/src/generate-text/anthropic/tool-search-regex.ts`
-
`examples/ai-functions/src/generate-text/anthropic/tool-search-deferred-bm25.ts`
-
`examples/ai-functions/src/generate-text/anthropic/tool-search-bm25.ts`

## Checklist

- [x] Tests have been added / updated (for bug fixes / features)
- [ ] Documentation has been added / updated (for bug fixes / features)
- [x] A _patch_ changeset for relevant packages has been added (for bug
fixes / features - run `pnpm changeset` in the project root)
- [x] I have reviewed this pull request (self-review)
@aayush-kapoor aayush-kapoor merged commit ebb02ea into main Mar 17, 2026
19 checks passed
@aayush-kapoor aayush-kapoor deleted the aayush/vertex-toolsearch branch March 17, 2026 14:41
vercel-ai-sdk bot pushed a commit that referenced this pull request Mar 17, 2026
## Background

#13337

We currently did not include the Tool Search tools exposed in the
anthropic provider for the vertex provider.

For this change to be added, we first needed to ensure we are not
passing the beta header since vertex rejects it.

## Summary

include the `toolSearchRegex_20251119` and `toolSearchBm25_20251119` in
`vertexAnthropicTools`

## Manual Verification

verified by running the examples: 
-
`examples/ai-functions/src/generate-text/google/vertex-anthropic-tool-search-regex.ts`
-
`examples/ai-functions/src/generate-text/google/vertex-anthropic-tool-search-bm25.ts`
-
`examples/ai-functions/src/generate-text/google/vertex-anthropic-tool-search-deferred-bm25.ts`

along with the streaming examples

## Checklist

- [x] Tests have been added / updated (for bug fixes / features)
- [ ] Documentation has been added / updated (for bug fixes / features)
- [x] A _patch_ changeset for relevant packages has been added (for bug
fixes / features - run `pnpm changeset` in the project root)
- [x] I have reviewed this pull request (self-review)

## Related Issues

Fixes #13337
@vercel-ai-sdk vercel-ai-sdk bot removed the backport Admins only: add this label to a pull request in order to backport it to the prior version label Mar 17, 2026
@vercel-ai-sdk
Copy link
Copy Markdown
Contributor

vercel-ai-sdk bot commented Mar 17, 2026

✅ Backport PR created: #13517

vercel-ai-sdk bot added a commit that referenced this pull request Mar 17, 2026
…13517)

This is an automated backport of #13497 to the release-v6.0 branch. FYI
@aayush-kapoor

Co-authored-by: Aayush Kapoor <83492835+aayush-kapoor@users.noreply.github.com>
@vercel-ai-sdk
Copy link
Copy Markdown
Contributor

vercel-ai-sdk bot commented Mar 17, 2026

🚀 Published in:

Package Version
@ai-sdk/google-vertex 5.0.0-beta.16

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai/provider related to a provider package. Must be assigned together with at least one `provider/*` label bug Something isn't working as documented provider/anthropic Issues related to the @ai-sdk/anthropic provider provider/google-vertex Issues related to the @ai-sdk/google-vertex provider

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature Request: Add Tool Search support for Google Vertex Anthropic provider

2 participants