Commit graph

4 commits

Author SHA1 Message Date
Jeremiah Lowin
d34f065417 Move OpenAI sampling handler out of experimental
- Move from fastmcp.experimental.sampling.handlers.openai to fastmcp.server.sampling.openai
- Update docs and tests to use new import path
- Remove experimental handlers directory
2025-12-09 15:07:13 -05:00
Jeremiah Lowin
7e02fa29b2 Add Anthropic sampling handler and consolidate sampling examples
- Add AnthropicSamplingHandler in server/sampling/anthropic.py
- Consolidate all sampling examples into examples/sampling/ with rich output
- Examples: text.py, structured_output.py, tool_use.py, server_fallback.py
- Add anthropic optional dependency
2025-12-09 15:04:35 -05:00
Jeremiah Lowin
5c0f05511b Remove @sampling_tool decorator - pass functions directly to sample()
Functions passed to ctx.sample(tools=[...]) are now auto-converted
via SamplingTool.from_function(). Users can still use that method
directly for custom name/description overrides.
2025-12-04 22:19:27 -05:00
Jeremiah Lowin
5fb9103e4c WIP: Sampling API with SamplingResult[T] and result_type 2025-12-04 11:39:30 -05:00