Add Google ADK TinyFish integration#15
Conversation
Adds the Google ADK package with SDK-backed function tools for web automation, queued runs, run lookup, web search, content fetch, and browser session creation. Uses tinyfish>=0.2.5, includes focused tests, and adds scoped CI plus PyPI trusted-publishing workflows.
There was a problem hiding this comment.
Actionable comments posted: 4
🧹 Nitpick comments (3)
google-adk/tests/test_tools.py (1)
44-49: ⚡ Quick winAdd a wrapper-level regression test for missing API key handling.
You test
_get_client()failure directly, but not the public tool behavior when client init fails.Example test to lock tool contract
+def test_web_agent_returns_error_when_api_key_missing(monkeypatch: pytest.MonkeyPatch) -> None: + monkeypatch.delenv("TINYFISH_API_KEY", raising=False) + with patch("tinyfish_adk.tools._client", None): + result = tinyfish_web_agent("https://example.com", "Extract title") + assert result.startswith("Error:")Also applies to: 83-118
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@google-adk/tests/test_tools.py` around lines 44 - 49, Add a regression test that exercises the public wrapper that depends on _get_client (call the public get_client() wrapper) to ensure missing API key handling bubbles up: in the test clear TINYFISH_API_KEY via monkeypatch.delenv(...), patch tinyfish_adk.tools._client to None, then call get_client() and assert it raises RuntimeError with a message containing "TINYFISH_API_KEY" (mirrors the existing _get_client() unit test but at the public wrapper level)..github/workflows/google-adk-publish.yml (1)
22-34: ⚡ Quick winPin third-party actions to immutable commit SHAs in the publish workflow.
Using mutable tags in a release pipeline weakens supply-chain guarantees. GitHub recommends pinning to full-length commit SHAs as the only way to treat action references as immutable releases. Replace the current tags with:
actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd(v6.0.2)actions/setup-python@c8813ba1bc76ebf779b911ad8ffccbf2e449cb48(v6.2.0)pypa/gh-action-pypi-publish@<pinned-sha>(pin release/v1 to a specific v1.x.x release)🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In @.github/workflows/google-adk-publish.yml around lines 22 - 34, Replace mutable action tags with immutable full commit SHAs: update the actions/checkout@v6 reference to actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd and actions/setup-python@v6 to actions/setup-python@c8813ba1bc76ebf779b911ad8ffccbf2e449cb48, and pin pypa/gh-action-pypi-publish@release/v1 to a specific release commit SHA (replace the placeholder <pinned-sha> with the full commit SHA for the desired v1.x.x release); ensure the three action entries (actions/checkout, actions/setup-python, pypa/gh-action-pypi-publish) in the workflow are updated so the workflow references immutable SHAs..github/workflows/google-adk-ci.yml (1)
37-39: ⚡ Quick winAdd package build verification to CI
The workflow runs lint/tests but skips the build check listed in the PR verification commands. Adding a build step will catch packaging issues (missing files/metadata) before merge.
Suggested patch
- run: make test + - run: python -m build🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In @.github/workflows/google-adk-ci.yml around lines 37 - 39, Add a package build verification step to the CI job that currently runs "make lint" and "make test" by inserting a "run: make build" (or the project's package build target, e.g., "make package" / "npm run build") step in the same job; ensure it runs (and fails the job on non‑zero exit) so packaging/metadata issues are caught before merge—locate the lines containing "make lint" and "make test" in the workflow and add the build step nearby (typically after lint and before or after tests, per project preference).
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@google-adk/README.md`:
- Around line 61-69: The example uses the Agent class but doesn't import it,
causing copy-paste failures; update the snippet to import Agent (e.g., from the
appropriate package/module that provides Agent alongside tinyfish_queue_run and
tinyfish_get_run) so the top of the example imports Agent and the tinyfish
helpers before creating Agent(name="async_scraper", ...), ensuring Agent,
tinyfish_queue_run and tinyfish_get_run are all imported.
- Around line 113-117: Add a language identifier to the fenced code block
containing the example goals so it satisfies markdownlint MD040; locate the
triple-backtick block that wraps the three strings ("Extract all product
names..." etc.) in README.md and change the opening fence from ``` to ```text so
the block is explicitly marked as plain text.
In `@google-adk/src/tinyfish_adk/tools.py`:
- Around line 134-135: Multiple tool entry points call _get_client() directly
causing a raised exception to escape instead of returning an error string;
update each tool entry function (the places that currently call _get_client()
and _run_kwargs(), e.g., the occurrences at the noted spots) to wrap client
initialization in a try/except: call _get_client() inside a try block, on
exception catch the error and return an error string like f"Error: {e}" (or
propagate the same error-format used elsewhere), and only proceed to call
_run_kwargs() and the rest of the function when client creation succeeds; apply
this same pattern to every function that currently does `client = _get_client()`
(including the other listed occurrences).
- Around line 223-243: tinyfish_list_runs currently passes the `limit` through
to the SDK without checking the documented 1-100 bounds; add validation at the
start of the function (before building kwargs) to ensure 1 <= limit <= 100 and
return a clear error string like the existing status check if invalid (e.g.,
"Error: Invalid limit: {limit!r}, must be between 1 and 100"); update the
function around the `kwargs` construction so callers never invoke the SDK with
out-of-range limits and keep the existing RunStatus handling unchanged.
---
Nitpick comments:
In @.github/workflows/google-adk-ci.yml:
- Around line 37-39: Add a package build verification step to the CI job that
currently runs "make lint" and "make test" by inserting a "run: make build" (or
the project's package build target, e.g., "make package" / "npm run build") step
in the same job; ensure it runs (and fails the job on non‑zero exit) so
packaging/metadata issues are caught before merge—locate the lines containing
"make lint" and "make test" in the workflow and add the build step nearby
(typically after lint and before or after tests, per project preference).
In @.github/workflows/google-adk-publish.yml:
- Around line 22-34: Replace mutable action tags with immutable full commit
SHAs: update the actions/checkout@v6 reference to
actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd and
actions/setup-python@v6 to
actions/setup-python@c8813ba1bc76ebf779b911ad8ffccbf2e449cb48, and pin
pypa/gh-action-pypi-publish@release/v1 to a specific release commit SHA (replace
the placeholder <pinned-sha> with the full commit SHA for the desired v1.x.x
release); ensure the three action entries (actions/checkout,
actions/setup-python, pypa/gh-action-pypi-publish) in the workflow are updated
so the workflow references immutable SHAs.
In `@google-adk/tests/test_tools.py`:
- Around line 44-49: Add a regression test that exercises the public wrapper
that depends on _get_client (call the public get_client() wrapper) to ensure
missing API key handling bubbles up: in the test clear TINYFISH_API_KEY via
monkeypatch.delenv(...), patch tinyfish_adk.tools._client to None, then call
get_client() and assert it raises RuntimeError with a message containing
"TINYFISH_API_KEY" (mirrors the existing _get_client() unit test but at the
public wrapper level).
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 1e3bbc49-01ac-4119-a1e3-34cc563945bc
📒 Files selected for processing (10)
.github/workflows/google-adk-ci.yml.github/workflows/google-adk-publish.ymlgoogle-adk/.gitignoregoogle-adk/Makefilegoogle-adk/README.mdgoogle-adk/pyproject.tomlgoogle-adk/requirements-dev.txtgoogle-adk/src/tinyfish_adk/__init__.pygoogle-adk/src/tinyfish_adk/tools.pygoogle-adk/tests/test_tools.py
Return tool-friendly client initialization errors, validate run-list limits, support SDK data responses, fix README examples, and add CI build coverage.
Summary
Tests