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.0a2.tar.gz (8.2 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.0a2-py3-none-any.whl (9.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: ppx_google_adk-0.1.0a2.tar.gz
  • Upload date:
  • Size: 8.2 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.0a2.tar.gz
Algorithm Hash digest
SHA256 45d959fe672f2d2150bbcf28369028c00d8b287e0bc1224f1bee86ed102cf6b5
MD5 25145579cb6dc147a2ab3a15bf62f725
BLAKE2b-256 4e7840ba27a611ea81117ba93d18b7c35fc33db9cda06a51bd3fc3779006732c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ppx_google_adk-0.1.0a2-py3-none-any.whl
Algorithm Hash digest
SHA256 b6547252c0e474539ffbda8f97a80ce7a189b66c3b390aa7ed9a85b9806a5472
MD5 908e40c16eeadc61ceb8e154d6170475
BLAKE2b-256 b829bc13b26c081a2f3b1e10d2cfcb9cbb9f52fadd6e6815ffeb951ca04f83c6

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