Show issues from last 30 days
<!-- Welcome to contributing to AI SDK! We're excited to see your changes. We suggest you read the following contributing guide we've created before submitting: https://github.com/vercel/ai/blob/main/CONTRIBUTING.md -->

Background

Anthropic just announced the availability of web search in their API. This feature is really exciting to me.

Summary

Added support for what is presented in the documentation.

Verification

I currently just got it to work:

const gen = await generateText({
	model,
	prompt,
	tools: {
		web_search: anthropic.tools.webSearch_20250305({
			max_uses: 2,
		}),
	},
	maxSteps: 3
})

Tasks

  • Get the basic feature to work
  • Make sure the output from the server is correctly mapped in the SDK response
  • Check types and schema validations (some have been done very quickly to get it to work late at night)
  • 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)
  • Formatting issues have been fixed (run pnpm prettier-fix in the project root)

Disclaimer

I've only contributed to documentation before, I hope this will help. And I'd also understand if it doesn't, I really don't mind if this gets closed for any reason.

I don't know how to write tests my self, must admit these have been wrote by Gemini.

Next issue in about 21 hours