Gemini Target adapter for Waken — routes waken Events to Google's google-genai SDK.
Project description
waken-gemini
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
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
873e3dfd3df97f8245c4dd7c3b81eaf60b176f6e8e83622fca963ccfa5e7f0df
|
|
| MD5 |
bb8f19300e403facee1b8fbf5ae99cdb
|
|
| BLAKE2b-256 |
ad3e7a374a8c8e9343d1c02ba65f07acb79abaed900d5b1e0a25f5c611ad74e4
|
Provenance
The following attestation bundles were made for waken_gemini-0.1.0.tar.gz:
Publisher:
publish.yml on WakenHQ/waken-gemini
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
waken_gemini-0.1.0.tar.gz -
Subject digest:
873e3dfd3df97f8245c4dd7c3b81eaf60b176f6e8e83622fca963ccfa5e7f0df - Sigstore transparency entry: 2082008352
- Sigstore integration time:
-
Permalink:
WakenHQ/waken-gemini@141d59108e1277699f26fef22ec6a15e8d61a040 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/WakenHQ
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@141d59108e1277699f26fef22ec6a15e8d61a040 -
Trigger Event:
push
-
Statement type:
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f693e1ec153bd3ea5c4f64728dccdd6323d73e0460e986fef4912caa8e3c084a
|
|
| MD5 |
f1ca00d9bdfc4feca4b3552dbd10cc20
|
|
| BLAKE2b-256 |
4ea0a1db7e6d2edf48b7c5925887800576279097127d267c0f1a8b1444909284
|
Provenance
The following attestation bundles were made for waken_gemini-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on WakenHQ/waken-gemini
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
waken_gemini-0.1.0-py3-none-any.whl -
Subject digest:
f693e1ec153bd3ea5c4f64728dccdd6323d73e0460e986fef4912caa8e3c084a - Sigstore transparency entry: 2082008357
- Sigstore integration time:
-
Permalink:
WakenHQ/waken-gemini@141d59108e1277699f26fef22ec6a15e8d61a040 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/WakenHQ
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@141d59108e1277699f26fef22ec6a15e8d61a040 -
Trigger Event:
push
-
Statement type: