gemini Genkit Releases · · 0.8.0

Genkit Python SDK v0.8.0: Expanded Google AI support, multi-region routing

sdkaideprecationmedia
breaking patch

Genkit Python SDK v0.8.0 introduces expanded model support and multi-region routing for Google GenAI and Vertex AI integrations, along with a modernized plugin packaging architecture. This release impacts Python developers integrating with Google's AI services, offering new capabilities like multimodal embeddings and generative video models. A staged rollout maintains compatibility for most plugins while core and Google GenAI packages are updated, with a clear migration path for the renamed Google GenAI plugin.

  • from genkit.plugins.google_genai import GoogleAI, VertexAI + from genkit_google_genai import GoogleAI, VertexAI
  • Streaming Usage & Telemetry: Reported accurate finish reasons and cumulative token usage on Gemini generate_stream executions
  • Generate Option Types: Updated output_instructions parameter in ai.generate() to accept boolean flags
  • Core Stability: Resolved edge-case streaming syntax evaluation failures and a runtime crash on missing default parameter values
Breaking changes (4)
  • Core Namespace Clean-up: Core (genkit) no longer ships or initializes a central genkit.plugins namespace. Old genkit.plugins.* import paths are now dynamically served by individual installed plugin packages via standard Python namespace packaging—eliminating tight coupling and dependency bloat in core

  • Zero-Downtime Transition (Tombstoning): Installing the legacy genkit-plugin-google-genai==0.8.0 package deploys a lightweight compatibility tombstone that automatically re-exports all classes from the new module while raising an actionable DeprecationWarning. Existing apps will continue running without immediate code changes, allowing teams to migrate incrementally

  • from genkit.plugins.google_genai import GoogleAI, VertexAI + from genkit_google_genai import GoogleAI, VertexAI
  • Action Required for Custom Middleware Authors: Middleware inspecting params.request inside wrap_generate should transition to params.options. If you need direct access to raw HTTP model payloads, migrate your interceptor to wrap_model (via ModelHookParams.request) or wrap_tool (ToolHookParams) for tool execution intercepts

Fixes (6)
  • Gemini Tool Role Compatibility: Solved 400 Bad Request API rejections on Gemini 3.6 / gemini-flash-latest by mapping tool execution history turns from Role.TOOL to "user", ensuring compatibility with Gemini's strict turn-role validation

  • Streaming Usage & Telemetry: Reported accurate finish reasons and cumulative token usage on Gemini generate_stream executions
  • Model Discovery & Embedders: Fixed runtime discovery for Vertex AI models referenced by name and ensured only callable Vertex embedders are listed in registries

  • Generate Option Types: Updated output_instructions parameter in ai.generate() to accept boolean flags
  • Core Stability: Resolved edge-case streaming syntax evaluation failures and a runtime crash on missing default parameter values
  • Developer Experience: Added helpful onboarding feedback when GEMINI_API_KEY is missing from the environment , and promoted generic "latest" Gemini model aliases in documentation

Read the original announcement →

https://github.com/genkit-ai/genkit/releases/tag/py/v0.8.0

Related releases