You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
@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)
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.
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.
# 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.
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 👍
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
Changes Made
Testing
Describe the tests you ran to verify your changes:
pytest)mypy src)ruff check src tests)Checklist
Breaking Changes
None
Screenshots (if applicable)
N/A
Additional Notes