Skip to content

feat: Auto-enable Google ADK integration in braintrust package#13

Merged
AbhiPrasad merged 7 commits intomainfrom
abhi-move-adk-integration
Feb 27, 2026
Merged

feat: Auto-enable Google ADK integration in braintrust package#13
AbhiPrasad merged 7 commits intomainfrom
abhi-move-adk-integration

Conversation

@AbhiPrasad
Copy link
Member

@AbhiPrasad AbhiPrasad commented Feb 25, 2026

This PR deprecates the braintrust-adk package in favour of using auto instrumentation with the braintrust package.

AI Summary

This branch moves the Google ADK integration from the standalone braintrust-adk PyPI package (integrations/adk-py/) into the main braintrust package, following the same pattern as Agno, Google GenAI, Claude Agent SDK, and other integrations.

What changed

New files in main package (py/):

  • py/src/braintrust/wrappers/adk/__init__.py — ADK wrapper module with setup_adk, wrap_agent, wrap_runner, wrap_flow, wrap_mcp_tool
  • py/src/braintrust/wrappers/adk/test_adk.py — Main integration tests (moved from integrations/adk-py/)
  • py/src/braintrust/wrappers/adk/test_adk_mcp_tool.py — MCP tool tracing tests (moved from integrations/adk-py/)
  • py/src/braintrust/wrappers/adk/test_auto_adk.py — Auto-instrument verification script
  • py/examples/adk/ — Example scripts for auto and manual patching
  • VCR cassettes moved to py/src/braintrust/wrappers/cassettes/

Modified files:

  • py/src/braintrust/auto.py — Added adk: bool = True parameter to auto_instrument() and _instrument_adk() function
  • py/noxfile.py — Added test_google_adk nox session with version matrix (latest, 1.14.1)
  • py/Makefile — Added google-adk to install-optional

Integration package (integrations/adk-py/) — now a deprecation shim:

  • src/braintrust_adk/__init__.py — Replaced with a thin shim that emits DeprecationWarning and re-exports only the public API from braintrust.wrappers.adk
  • pyproject.toml — Bumped to 0.4.0, marked Development Status :: 7 - Inactive, requires braintrust>=0.6.0
  • README.md — Added deprecation notice with migration instructions
  • Tests replaced with test_reexports.py — verifies the public API re-exports and deprecation warning

Test fixes for cross-version compatibility

  • Used ANY matcher for live_connect_config (structure differs between ADK versions)
  • Changed output assertions from exact dict equality to individual key checks (newer ADK adds model_version)
  • Added version-conditional check for avg_logprobs (only present in ADK >= 1.15.0)
  • Fixed test_setup_adk_patches_mcp_tool — replaced fragile sys.modules manipulation with patch("google.adk.tools.mcp_tool.mcp_tool")

Migration Guide: braintrust-adk to braintrust

Before (old)

pip install braintrust-adk
from braintrust_adk import setup_adk

setup_adk(project_name="my-project")

After (new)

pip install braintrust
# No need for braintrust-adk anymore
pip uninstall braintrust-adk  # optional cleanup

Option 1: Auto-instrument (recommended)

from braintrust import auto_instrument

auto_instrument()
# ADK tracing is now enabled automatically alongside OpenAI, Anthropic, etc.

Option 2: Explicit setup

from braintrust.wrappers.adk import setup_adk

setup_adk(project_name="my-project")

What stays the same

  • All public API functions (setup_adk, wrap_agent, wrap_runner, wrap_flow, wrap_mcp_tool) work identically
  • Existing from braintrust_adk import setup_adk imports still work but emit a DeprecationWarning

What to update

  1. Change imports from braintrust_adk to braintrust.wrappers.adk (or use auto_instrument())
  2. Remove braintrust-adk from your dependencies — braintrust now includes ADK support with no extra package

@AbhiPrasad AbhiPrasad force-pushed the abhi-move-adk-integration branch from a20371d to 93b84e6 Compare February 26, 2026 00:04
@AbhiPrasad AbhiPrasad marked this pull request as ready for review February 26, 2026 00:05
@AbhiPrasad AbhiPrasad requested a review from ibolmo February 26, 2026 00:05
@AbhiPrasad AbhiPrasad changed the title feat: Auto-enable Google SDK integration in braintrust package feat: Auto-enable Google ADK integration in braintrust package Feb 26, 2026
Copy link
Contributor

@ibolmo ibolmo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, ty!

_extract_model_name,
_is_patched,
_omit,
_serialize_config,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i wouldn't re-import private funcs

@AbhiPrasad AbhiPrasad merged commit 3a4dde0 into main Feb 27, 2026
33 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants