Add Google GenAI Sampling Handler (#2977)

* Add Google GenAI sampling handler

Co-authored-by: Bill Easton <strawgate@users.noreply.github.com>

* chore: Update SDK documentation

* Filter non-Gemini model hints in _get_model

Match the Anthropic/OpenAI handler pattern of only selecting
provider-compatible models from hints.

---------

Co-authored-by: claude[bot] <41898282+claude[bot]@users.noreply.github.com>
Co-authored-by: Bill Easton <strawgate@users.noreply.github.com>
Co-authored-by: marvin-context-protocol[bot] <225465937+marvin-context-protocol[bot]@users.noreply.github.com>
Co-authored-by: Jeremiah Lowin <153965+jlowin@users.noreply.github.com>
This commit is contained in:
Bill Easton 2026-03-02 17:00:03 -06:00 committed by GitHub
commit 49534ce91d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 868 additions and 4 deletions

View file

@ -0,0 +1,17 @@
---
title: google_genai
sidebarTitle: google_genai
---
# `fastmcp.client.sampling.handlers.google_genai`
Google GenAI sampling handler with tool support for FastMCP 3.0.
## Classes
### `GoogleGenaiSamplingHandler` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/client/sampling/handlers/google_genai.py#L54" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>
Sampling handler that uses the Google GenAI API with tool support.