Skip to main content
Pre-release

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.0a1 on PyPI and 0.1.0-alpha.1 on 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

ppx_google_adk-0.1.0a1.tar.gz (8.4 kB view details)

Uploaded Source

Built Distribution

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

ppx_google_adk-0.1.0a1-py3-none-any.whl (9.7 kB view details)

Uploaded Python 3

File details

Details for the file ppx_google_adk-0.1.0a1.tar.gz.

File metadata

  • Download URL: ppx_google_adk-0.1.0a1.tar.gz
  • Upload date:
  • Size: 8.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.12.3

File hashes

Hashes for ppx_google_adk-0.1.0a1.tar.gz
Algorithm Hash digest
SHA256 915328a7d1f3f14ea8d2e785acad9eecc713ceb79d84bcaae264a811266d387f
MD5 55c3600643ce15ccb82202861b58fc0d
BLAKE2b-256 4c47fd0956c244882eac9f4ffe9d36a00de143a16006dd6ee8fd53182e33e421

See more details on using hashes here.

File details

Details for the file ppx_google_adk-0.1.0a1-py3-none-any.whl.

File metadata

File hashes

Hashes for ppx_google_adk-0.1.0a1-py3-none-any.whl
Algorithm Hash digest
SHA256 fc52f52ac6135c724ac9e4fac53ec6fb047488b71455793d075097f46a46482b
MD5 d69f6606359dac2b8bd468892deaa19e
BLAKE2b-256 5ff3beeae6d45685e8fd66d88676dbd6c0ff34a03c013d6a48c346dea4aeba31

See more details on using hashes here.

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