fastmcp/tests/client/sampling
Jeremiah Lowin c91c43e280
Add AnthropicSamplingHandler (#2617)
* Add AnthropicSamplingHandler

Adds a sampling handler for the Anthropic API at
fastmcp.client.sampling.handlers.anthropic, alongside the existing
OpenAI handler. Includes full support for tool calling.

Install with: pip install fastmcp[anthropic]

* Update default model

* Update sampling docs to cover both OpenAI and Anthropic handlers

* Use AsyncAnthropic, fix falsy value handling, handle tool_choice none

* Propagate isError to Anthropic, join multiple text blocks, fix docs
2025-12-14 16:07:22 -05:00
..
handlers Add AnthropicSamplingHandler (#2617) 2025-12-14 16:07:22 -05:00
__init__.py Unify SamplingHandler and promote OpenAI handler (#2616) 2025-12-14 15:22:43 -05:00