Skip to content

Feat/google adk polish - #26

Open
amanishimwe wants to merge 5 commits into
agentguard-ai:mainfrom
amanishimwe:feat/google-adk-polish
Open

Feat/google adk polish#26
amanishimwe wants to merge 5 commits into
agentguard-ai:mainfrom
amanishimwe:feat/google-adk-polish

Conversation

@amanishimwe

@amanishimwe amanishimwe commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

Pull Request

Description

Polishes the Google ADK integration for TealTiger: exports TealTigerCallback, adds Gemini pricing entries, wires model-based tool cost estimates (with fallback), and adds unit tests plus a runnable example.

Fixes #324

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Performance improvement
  • Code refactoring
  • [x ] Test improvements

Changes Made

  • Export TealTigerCallback from tealtiger. integrations
  • Add Gemini model pricing (gemini-2.5-flash, gemini-2.5-pro, gemini-3.5-flash, gemini-3.6-flash)
  • Estimate ADK tool cost from get_model_pricing (fixed 500/500 token estimate); fall back to cost_per_tool_call when pricing is missing
  • Add examples/google_adk_governance.py (mock before_tool / after_tool demo, no API key required)
  • Add/extend tests in tests/test_google_adk_integration.py and Gemini pricing coverage in tests/cost/test_pricing.py

Testing

Describe the tests you ran to verify your changes:

  • Unit tests pass (pytest)
  • Type checking passes (mypy src)
  • Linting passes (ruff check src tests)
  • Manual testing performed
  • Added new tests for new functionality

Checklist

  • My code follows the project's code style
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published

Breaking Changes

None

Screenshots (if applicable)

N/A

Additional Notes

  • Tool cost is an estimate (500 input + 500 output tokens) when the model exists in the pricing table; it is not live token usage from ADK.
  • A follow-up contribution to Google ADK contributing is planned separately (CLA required).
  • before_tool retains # noqa: C901 for pre-existing complexity.

@amanishimwe

Copy link
Copy Markdown
Contributor Author

@nagasatish007 , when you get time, please look at this one as well. A follow-up contribution to Google ADK contributing is planned separately (CLA required)

@nagasatish007

Copy link
Copy Markdown
Contributor

Thanks @amanishimwe — good work on this. The scope is clear and the PR description is thorough.

Looks good:

  • Export wiring for TealTigerCallback from integrations ✅
  • Gemini pricing entries (2.5-flash, 2.5-pro, 3.5-flash, 3.6-flash) ✅
  • Runnable example with no API key dependency ✅
  • Test coverage for both integration and pricing ✅

Questions/suggestions before merge:

  1. Fixed 500/500 token estimate for tool cost — is there a way to pull actual token counts from the ADK callback context (before_tool/after_tool)? Even an approximate count from len(str(args)) would be more accurate than a static 500. If ADK doesn't expose this, the fixed estimate is fine for now but let's add a # TODO: use actual token counts when ADK exposes them comment.

  2. CI status — showing 5/21 checks passing. Are the failures pre-existing (like the TypeScript repo's CostStorage issue) or related to this PR? If pre-existing, note that in a comment so we can track separately.

  3. # noqa: C901 in before_tool — understood it's pre-existing complexity. If you have bandwidth in a follow-up, would be good to refactor that method (extract helper functions for policy evaluation vs. cost tracking). Not blocking this PR though.

  4. Gemini model naming — are gemini-3.5-flash and gemini-3.6-flash confirmed production model names from Google? Want to make sure we're not adding pricing for beta/unreleased model IDs that might change.

Overall this is ready to merge once CI is clarified. Nice contribution 👍

@nagasatish007

Copy link
Copy Markdown
Contributor

@amanishimwe Also please join our Discore server : https://discord.gg/ZnCEd5Mk2

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