Skip to content

chore: release v0.14.0 - #130

Merged
huangjeff5 merged 1 commit into
mainfrom
release/v0.14.0
Nov 19, 2026
Merged

huangjeff5 merged 1 commit into
mainfrom
release/v0.14.0

Conversation

@huangjeff5

@huangjeff5 huangjeff5 commented Nov 13, 2026 •

Copy link
Copy Markdown
Collaborator

0.13 rewrote Genkit Python's veneer layer and public API surface to clean up ergonomics and typing ahead of 1.0. 0.14 keeps that API surface intact and focuses on hardening it before 1.0: we ran bug bashes across all surfaces—with an emphasis on Dev UI compatibility and provider plugins—and shipped those fixes alongside multi-tenant embedder configuration and a simpler response.media accessor.

1.0 is coming very soon—we're holding the 1.0 tag until we finish moving the Google GenAI plugin onto the Interactions API and cleaning up the Vertex AI plugin naming to match organizational changes, avoiding post-1.0 deprecations. We expect both to ship very soon, and in the meantime we will continue to ship small improvements and bug fixes we find from our thorough bug bashing.

uv add --upgrade genkit
# or: pip install --upgrade genkit

Configure embedders for multi-tenant use cases

GoogleAI() previously raised at startup if no environment API key was set, and ai.embed() had no way to pass a per-request key or tenant context down to an embedder (#49, #114).

GoogleAI() now starts keyless (logging one warning), and ai.embed() / ai.embed_many() accept context={'secrets': {'api_key': ...}}. Rejected keys report ErrorReason.INVALID_CREDENTIALS with status UNAUTHENTICATED.

from genkit import ErrorReason, Genkit
from genkit.embedder import EmbedContext, EmbedRequest, EmbedResponse
from genkit_google_genai import GoogleAI

# 1. Start without a server-wide API key
ai = Genkit(plugins=[GoogleAI()])

# 2. Bill each embed call to the caller's key
vectors = await ai.embed(
    embedder=GoogleAI.embedder('gemini-embedding-001'),
    content='Mushroom Risotto',
    context={'secrets': {'api_key': tenant_key}},
)
# => [Embedding(embedding=[...])]

# 3. Embedder handlers read the same context via EmbedContext
class MenuEmbedConfig(BaseModel):
    dimensions: int = 768

async def embed_menu(req: EmbedRequest[MenuEmbedConfig], ctx: EmbedContext) -> EmbedResponse:
    api_key = ctx.context['secrets']['api_key']
    ...

ai.define_embedder('custom/menu', embed_menu, config_schema=MenuEmbedConfig)

# 4. Detect rejected tenant keys on generate() calls
response = await ai.generate(
    model=GoogleAI.gemini('gemini-flash-latest'),
    prompt='Suggest a dish without peanuts.',
    context={'secrets': {'api_key': tenant_key}},
)
if response.error and response.error.reason is ErrorReason.INVALID_CREDENTIALS:
    await notify_tenant('Your Gemini key was rejected.')

response.media returns the first media item

Reading a generated image or audio part previously required indexing response.media[0]. response.media (along with Message.media and ModelResponseChunk.media) now returns Media | None directly, while the full list moves to media_parts (#47).

response = await ai.generate(
    model=GoogleAI.gemini_image('gemini-2.5-flash-image'),
    prompt='A watercolor of a cozy bakery.',
)

# 1. Single-image convenience accessor
if response.media:
    print(response.media.url)
    # => data:image/png;base64,iVBORw0KGgoAAAANSU...

# 2. Iterate all media parts when a model returns more than one
for part in response.media_parts:
    save_image(part.url)

Bug fixes

Dev UI & tracing

Provider plugins

Runtime, typing & prompts

Before you upgrade

FirestoreSessionStore requires an extra (#54)

genkit-google-cloud no longer installs google-cloud-firestore by default. Add the firestore extra if your app imports FirestoreSessionStore:

uv add 'genkit-google-cloud[firestore]'
# or: pip install 'genkit-google-cloud[firestore]'

response.media returns a single Media | None (#47)

# Before (0.13)
url = response.media[0].url
for item in response.media: ...

# After (0.14)
url = response.media.url
for item in response.media_parts: ...

Run your type checker to catch for item in response.media: loops—iterating a Pydantic model yields (field, value) tuples instead of raising at runtime.

Other notes

@huangjeff5
huangjeff5 marked this pull request as ready for review November 15, 2026 18:47
@huangjeff5
huangjeff5 force-pushed the release/v0.14.0 branch 2 times, most recently from a363012 to fdaff37 Compare November 18, 2026 22:37
@huangjeff5
huangjeff5 merged commit aec146f into main Nov 19, 2026
23 checks passed
@huangjeff5
huangjeff5 deleted the release/v0.14.0 branch November 19, 2026 15:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants