Compare commits

...

1 commit

Author SHA1 Message Date
Jeremiah Lowin
51a228a6ae
docs: quote all pip install extras for fastmcp sampling handlers 2026-07-20 11:06:30 -04:00
8 changed files with 12 additions and 12 deletions

View file

@ -128,7 +128,7 @@ client = Client(
``` ```
<Note> <Note>
Install the OpenAI handler with `pip install fastmcp[openai]`. Install the OpenAI handler with `pip install 'fastmcp[openai]'`.
</Note> </Note>
### Anthropic Handler ### Anthropic Handler
@ -146,7 +146,7 @@ client = Client(
``` ```
<Note> <Note>
Install the Anthropic handler with `pip install fastmcp[anthropic]`. Install the Anthropic handler with `pip install 'fastmcp[anthropic]'`.
</Note> </Note>
### Google Gemini Handler ### Google Gemini Handler
@ -164,7 +164,7 @@ client = Client(
``` ```
<Note> <Note>
Install the Google Gemini handler with `pip install fastmcp[gemini]`. Install the Google Gemini handler with `pip install 'fastmcp[gemini]'`.
</Note> </Note>
## Sampling Capabilities ## Sampling Capabilities

View file

@ -137,7 +137,7 @@ Client support for sampling is optional—some clients may not implement it. To
FastMCP provides built-in handlers for [OpenAI and Anthropic APIs](/clients/sampling#built-in-handlers). These handlers support the full sampling API including tools, automatically converting your Python functions to each provider's format. FastMCP provides built-in handlers for [OpenAI and Anthropic APIs](/clients/sampling#built-in-handlers). These handlers support the full sampling API including tools, automatically converting your Python functions to each provider's format.
<Note> <Note>
Install handlers with `pip install fastmcp[openai]` or `pip install fastmcp[anthropic]`. Install handlers with `pip install 'fastmcp[openai]'` or `pip install 'fastmcp[anthropic]'`.
</Note> </Note>
```python ```python

View file

@ -212,7 +212,7 @@ client = Client(
``` ```
<Note> <Note>
Install the OpenAI handler with `pip install fastmcp[openai]`. Install the OpenAI handler with `pip install 'fastmcp[openai]'`.
</Note> </Note>
### Anthropic Handler ### Anthropic Handler
@ -246,7 +246,7 @@ client = Client(
``` ```
<Note> <Note>
Install the Anthropic handler with `pip install fastmcp[anthropic]`. Install the Anthropic handler with `pip install 'fastmcp[anthropic]'`.
</Note> </Note>
### Tool Execution ### Tool Execution

View file

@ -446,7 +446,7 @@ Client support for sampling is optional—some clients may not implement it. To
FastMCP provides built-in handlers for [OpenAI and Anthropic APIs](/v2/clients/sampling#built-in-handlers). These handlers support the full sampling API including tools, automatically converting your Python functions to each provider's format. FastMCP provides built-in handlers for [OpenAI and Anthropic APIs](/v2/clients/sampling#built-in-handlers). These handlers support the full sampling API including tools, automatically converting your Python functions to each provider's format.
<Note> <Note>
Install handlers with `pip install fastmcp[openai]` or `pip install fastmcp[anthropic]`. Install handlers with `pip install 'fastmcp[openai]'` or `pip install 'fastmcp[anthropic]'`.
</Note> </Note>
```python ```python

View file

@ -5,7 +5,7 @@ These examples demonstrate FastMCP's sampling API, which allows server tools to
## Prerequisites ## Prerequisites
```bash ```bash
pip install fastmcp[anthropic] pip install 'fastmcp[anthropic]'
export ANTHROPIC_API_KEY=your-key export ANTHROPIC_API_KEY=your-key
``` ```
@ -59,4 +59,4 @@ from fastmcp.client.sampling.handlers.openai import OpenAISamplingHandler
handler = OpenAISamplingHandler(default_model="gpt-4o-mini") handler = OpenAISamplingHandler(default_model="gpt-4o-mini")
``` ```
And install with `pip install fastmcp[openai]`. And install with `pip install 'fastmcp[openai]'`.

View file

@ -1052,7 +1052,7 @@ def _build_picker_html(tools: list[dict[str, Any]]) -> str:
from prefab_ui.components.form import Form from prefab_ui.components.form import Form
from prefab_ui.rx import RESULT, Rx from prefab_ui.rx import RESULT, Rx
except ImportError: except ImportError:
return "<html><body><p>prefab-ui not installed. Run: pip install fastmcp[apps]</p></body></html>" return "<html><body><p>prefab-ui not installed. Run: pip install 'fastmcp[apps]'</p></body></html>"
if not tools: if not tools:
with Column(gap=4, css_class="p-6 max-w-2xl mx-auto") as view: with Column(gap=4, css_class="p-6 max-w-2xl mx-auto") as view:

View file

@ -41,7 +41,7 @@ try:
except ImportError as e: except ImportError as e:
raise ImportError( raise ImportError(
"The `anthropic` package is not installed. " "The `anthropic` package is not installed. "
"Install it with `pip install fastmcp-slim[anthropic]` or add `anthropic` to your dependencies." "Install it with `pip install 'fastmcp-slim[anthropic]'` or add `anthropic` to your dependencies."
) from e ) from e
__all__ = ["AnthropicSamplingHandler"] __all__ = ["AnthropicSamplingHandler"]

View file

@ -28,7 +28,7 @@ try:
except ImportError as e: except ImportError as e:
raise ImportError( raise ImportError(
"The `google-genai` package is not installed. " "The `google-genai` package is not installed. "
"Install it with `pip install fastmcp-slim[gemini]` or add `google-genai` " "Install it with `pip install 'fastmcp-slim[gemini]'` or add `google-genai` "
"to your dependencies." "to your dependencies."
) from e ) from e