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

Uploaded Python 3

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

Hashes for ppx_google_adk-0.1.0a4.tar.gz
Algorithm Hash digest
SHA256 16c4c3a42d153162957d8017ec1766ec362765d3b4a6f74387469d344bf66a47
MD5 1cf2b85420429ba0e30fb522210d5eee
BLAKE2b-256 83cb39de117c5bcffbf7601ad3ed8b7146b80e2a912c581941b66e4394c09db2

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ppx_google_adk-0.1.0a4-py3-none-any.whl
Algorithm Hash digest
SHA256 43bedf25db3f72de450a5451b85f1f716cf4c618e2193cf5d77734764faea7a5
MD5 8fc35891a10e99ffd34f4854d9c400e7
BLAKE2b-256 bb4657ce9b0916c0b3a204072db60c341a244025418fe080c2150ac879bf7fcf

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