Skip to main content

Gemini Target adapter for Waken — routes waken Events to Google's google-genai SDK.

Project description

waken-gemini

CI License: MIT

A Gemini Target adapter for Waken — "nginx for AI agents." Routes waken Events to Google's google-genai SDK and returns the result as a waken Response.

Install

pip install waken-gemini

Usage

from waken import Runtime
from waken_gemini import GeminiAdapter

runtime = Runtime()
runtime.target("gemini", GeminiAdapter())
runtime.run()

GeminiAdapter reads GEMINI_API_KEY from the environment — that's google-genai's own convention (see genai.Client()), nothing waken-specific. Pass api_key=... (or any other genai.Client keyword) to override:

runtime.target("gemini", GeminiAdapter(model="gemini-2.5-pro", api_key="..."))

Sessions

Gemini's SDK, unlike some other providers, has no server-side resumable session id — the google-genai Chat object keeps conversation history client-side, in process memory. So GeminiAdapter maps a waken session_id to the SDK's Chat object itself (not a string id) and keeps reusing that same object turn over turn. A practical consequence: conversation history for a given waken session does not survive an adapter process restart, since there is nothing server-side to resume from. An Event with no session_id gets a fresh one-off Chat every call and is never stored.

Development

git clone https://github.com/WakenHQ/waken-gemini
cd waken-gemini
pip install -e ".[dev]"
pytest

Tests mock google.genai.Client entirely — no API key or network access needed to run the suite.

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

waken_gemini-0.1.0.tar.gz (5.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

waken_gemini-0.1.0-py3-none-any.whl (4.3 kB view details)

Uploaded Python 3

File details

Details for the file waken_gemini-0.1.0.tar.gz.

File metadata

  • Download URL: waken_gemini-0.1.0.tar.gz
  • Upload date:
  • Size: 5.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for waken_gemini-0.1.0.tar.gz
Algorithm Hash digest
SHA256 873e3dfd3df97f8245c4dd7c3b81eaf60b176f6e8e83622fca963ccfa5e7f0df
MD5 bb8f19300e403facee1b8fbf5ae99cdb
BLAKE2b-256 ad3e7a374a8c8e9343d1c02ba65f07acb79abaed900d5b1e0a25f5c611ad74e4

See more details on using hashes here.

Provenance

The following attestation bundles were made for waken_gemini-0.1.0.tar.gz:

Publisher: publish.yml on WakenHQ/waken-gemini

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file waken_gemini-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: waken_gemini-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 4.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for waken_gemini-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f693e1ec153bd3ea5c4f64728dccdd6323d73e0460e986fef4912caa8e3c084a
MD5 f1ca00d9bdfc4feca4b3552dbd10cc20
BLAKE2b-256 4ea0a1db7e6d2edf48b7c5925887800576279097127d267c0f1a8b1444909284

See more details on using hashes here.

Provenance

The following attestation bundles were made for waken_gemini-0.1.0-py3-none-any.whl:

Publisher: publish.yml on WakenHQ/waken-gemini

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page