github genkit-ai/genkit py/v0.8.0
Genkit Python SDK v0.8.0

latest release: py/v0.8.1
5 hours ago

Genkit Python SDK v0.8.0 Release Notes

Genkit Python SDK v0.8.0 is here! This targeted release focuses on expanded model support and multi-region routing in our Google GenAI & Vertex AI integration, along with a cleaner, modernized plugin packaging architecture for Python developers.

Important

Staged Rollout & Release Rationale: This release deliberately scopes published distributions to our foundational packages: genkit (core) 0.8.0, genkit-google-genai 0.8.0, and a transition tombstone for genkit-plugin-google-genai 0.8.0.

Why a staged release? We are modernizing our plugin architecture and aligning naming conventions across our entire suite (genkit-<provider>). Rather than holding up critical Gemini updates and compatibility fixes while we await internal naming review for the remaining plugins, we are releasing core and google-genai today. Once package naming review completes, a fast-follow release will upgrade the remaining plugins to 0.8.0.

Impact & Compatibility: All other plugin packages remain at 0.7.0 on PyPI. They have been verified and smoke-tested to interoperate seamlessly against core 0.8.0—requiring zero updates or intervention from developers using those integrations.


What's New

Expanded Google AI & Vertex AI Support

This release broadens model coverage and feature capabilities in genkit-google-genai:

  • Vertex AI Multi-Region Support: Added multi-region support with dynamic per-request location overrides, making it straightforward to route deployments across Google Cloud regions (#5763).
  • Multimodal Embeddings: Supported Vertex AI multimodal embeddings via :predict (#5649) and registered Gemini embedding-2 (#5596).
  • Expanded Model Catalog: Registered Gemini 3.1 text models (#5559, #5588), Gemini 3.x image generation suites (#5579), tuned Gemini endpoints (#5182), and Veo 3.x generative video models (#5174).

Breaking Changes & Migration

Package Rename & Namespace Modernization (#5703)

To align with standard Python ecosystem conventions, the Google GenAI plugin has been transitioned from genkit-plugin-google-genai to genkit-google-genai, and its primary module import path from genkit.plugins.google_genai to genkit_google_genai.

  • 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.

Recommended Migration Step:

# Swap dependency naming in your project workspace
uv remove genkit-plugin-google-genai
uv add genkit-google-genai
- from genkit.plugins.google_genai import GoogleAI, VertexAI
+ from genkit_google_genai import GoogleAI, VertexAI

Refined Middleware Lifecycle Hooks (#5694)

For improved separation of concerns between conversational orchestration and transport layers, GenerateHookParams passed to wrap_generate no longer includes the transport request. It now provides clean access to options (GenerateActionOptions), iteration, and message_index.

  • 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 & Polish

  • 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 (#5780).
  • Streaming Usage & Telemetry: Reported accurate finish reasons and cumulative token usage on Gemini generate_stream executions (#5736).
  • Model Discovery & Embedders: Fixed runtime discovery for Vertex AI models referenced by name (#5575) and ensured only callable Vertex embedders are listed in registries (#5695).
  • Generate Option Types: Updated output_instructions parameter in ai.generate() to accept boolean flags (#5681).
  • Core Stability: Resolved edge-case streaming syntax evaluation failures and a runtime crash on missing default parameter values (#5340).
  • Developer Experience: Added helpful onboarding feedback when GEMINI_API_KEY is missing from the environment (#5665), and promoted generic "latest" Gemini model aliases in documentation (#5540).

Don't miss a new genkit release

NewReleases is sending notifications on new releases.