Skip to main content

TraceAI Google ADK Instrumentation

pypi

Python auto-instrumentation library for Google ADK.

Quickstart

In this example we will instrument a small program that uses Gemini and observe the traces in Future AGI Dashboard

Install packages.

pip install traceai-google-adk

In a python file, set up the GoogleADKInstrumentor and configure the tracer to send traces to Observe.

import asyncio

from fi_instrumentation import register
from fi_instrumentation.fi_types import ProjectType
from google.adk.agents import Agent
from google.adk.runners import InMemoryRunner
from google.genai import types

from traceai_google_adk import GoogleADKInstrumentor

tracer_provider = register(
    project_name="test_project",
    project_type=ProjectType.OBSERVE,
)


GoogleADKInstrumentor().instrument(tracer_provider=tracer_provider)


def get_weather(city: str) -> dict:
    """Retrieves the current weather report for a specified city.

    Args:
        city (str): The name of the city for which to retrieve the weather report.

    Returns:
        dict: status and result or error msg.
    """
    if city.lower() == "new york":
        return {
            "status": "success",
            "report": (
                "The weather in New York is sunny with a temperature of 25 degrees"
                " Celsius (77 degrees Fahrenheit)."
            ),
        }
    else:
        return {
            "status": "error",
            "error_message": f"Weather information for '{city}' is not available.",
        }


agent = Agent(
    name="test_agent",
    model="gemini-2.5-flash-preview-05-20",
    description="Agent to answer questions using tools.",
    instruction="You must use the available tools to find an answer.",
    tools=[get_weather],
)


async def main():
    app_name = "test_instrumentation"
    user_id = "test_user"
    session_id = "test_session"
    runner = InMemoryRunner(agent=agent, app_name=app_name)
    session_service = runner.session_service
    await session_service.create_session(
        app_name=app_name, user_id=user_id, session_id=session_id
    )
    async for event in runner.run_async(
        user_id=user_id,
        session_id=session_id,
        new_message=types.Content(
            role="user", parts=[types.Part(text="What is the weather in New York?")]
        ),
    ):
        if event.is_final_response():
            print(event.content.parts[0].text.strip())


if __name__ == "__main__":
    asyncio.run(main())

Since we are using Gemini, we must set the GOOGLE_API_KEY environment variable to authenticate with the Gemini API.

export GOOGLE_API_KEY=your-api-key

Run the python file to send the traces to Future AGI Platform.

python your_file.py

Metadata

Release files for traceAI-google-adk 0.1.6

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for traceAI-google-adk 0.1.6
File Size Uploaded Provenance Actions
traceai_google_adk-0.1.6.tar.gz 9.9 kB With provenance Details for traceai_google_adk-0.1.6.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for traceAI-google-adk 0.1.6
File Interpreter ABI Platform Actions
traceai_google_adk-0.1.6-py3-none-any.whl Python 3 none any Details for traceai_google_adk-0.1.6-py3-none-any.whl

Total release size: 19.6 kB

Release files / traceai_google_adk-0.1.6.tar.gz

Download URL traceai_google_adk-0.1.6.tar.gz
Size 9.9 kB
Tags Source
SHA-256 checksum
How to use checksums
ab3e95a8894d489a166dd70c8165dc19518b3dd85206d38c2c2934848bebbef6
BLAKE2b-256 checksum
How to use checksums
76cb92eb9c070117b219abb7873c53d94a1bafb90643369686a46e5ba1111275
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 31, 2026.

Transparency log

Release files / traceai_google_adk-0.1.6-py3-none-any.whl

Download URL traceai_google_adk-0.1.6-py3-none-any.whl
Size 9.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
fea346683a66efc2965c883dd79152de7e082fb99b52e2c80ad7368459eb7555
BLAKE2b-256 checksum
How to use checksums
47d549741b7f237e5928545a94fb3cbd50ce03fede414eb56f9a2b9872daa458
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 31, 2026.

Transparency log

Security for traceAI-google-adk 0.1.6

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for traceai_google_adk-0.1.6.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 31, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page