This release is a pre-release and may not be stable for production use.
ppx-google-adk
Google Agent Development Kit (ADK) integration for the Preference Profile Exchange (PPX).
Install
pip install ppx-google-adk
Requires Python 3.11+. Published version: 0.1.0a1 (PyPI).
Alpha, tracking a draft specification. Expect breaking changes. The version is
0.1.0a1on PyPI and0.1.0-alpha.1on npm — the same release in each ecosystem's required format.
Use PPX from an ADK agent
Two complementary patterns.
Pattern 1 — Inject preferences as context at session start
from ppx_client import PpxClient
from ppx_google_adk import fetch_preference_context
from google.adk.agents import LlmAgent
client = PpxClient("https://api.provider.app")
preferences = fetch_preference_context(
client,
grant_token=my_grant_token,
context={"climate": "hot_humid"},
requested_namespaces=["core", "fragrance"],
)
agent = LlmAgent(
name="scent_advisor",
model="gemini-2.0-flash",
instruction=(
"You recommend fragrances. Use the user's preferences below when suggesting.\n\n"
+ preferences
),
)
The agent sees a deterministic, grant-scoped block of claims — no tool call needed — and the model can cite specific preferences in its output.
Pattern 2 — Let the agent call PPX on demand
from google.adk.agents import LlmAgent
from google.adk.tools import FunctionTool
from ppx_google_adk import build_preference_tool
lookup = build_preference_tool(client, grant_token=my_grant_token)
agent = LlmAgent(
name="scent_advisor",
model="gemini-2.0-flash",
instruction="When relevant, call lookup_user_preference to check the user's preferences.",
tools=[FunctionTool(lookup)],
)
Every tool invocation is grant-scoped. The agent can never see claims the user hasn't authorized; out-of-scope keys are silently redacted by the provider.
Combining both patterns
For long-running agents, inject a small baseline preference context (pattern 1) and register the tool (pattern 2) so the agent can refine its understanding with targeted queries without re-reading the full profile on every turn.
License
Apache-2.0.
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 ppx_google_adk-0.1.0a4.tar.gz.
File metadata
- Download URL: ppx_google_adk-0.1.0a4.tar.gz
- Upload date:
- Size: 8.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
16c4c3a42d153162957d8017ec1766ec362765d3b4a6f74387469d344bf66a47
|
|
| MD5 |
1cf2b85420429ba0e30fb522210d5eee
|
|
| BLAKE2b-256 |
83cb39de117c5bcffbf7601ad3ed8b7146b80e2a912c581941b66e4394c09db2
|
File details
Details for the file ppx_google_adk-0.1.0a4-py3-none-any.whl.
File metadata
- Download URL: ppx_google_adk-0.1.0a4-py3-none-any.whl
- Upload date:
- Size: 9.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
43bedf25db3f72de450a5451b85f1f716cf4c618e2193cf5d77734764faea7a5
|
|
| MD5 |
8fc35891a10e99ffd34f4854d9c400e7
|
|
| BLAKE2b-256 |
bb4657ce9b0916c0b3a204072db60c341a244025418fe080c2150ac879bf7fcf
|