Skip to content

Add Google ADK TinyFish integration#15

Open
pranavjana wants to merge 2 commits into
mainfrom
pranav/google-adk-sdk-tools
Open

Add Google ADK TinyFish integration#15
pranavjana wants to merge 2 commits into
mainfrom
pranav/google-adk-sdk-tools

Conversation

@pranavjana
Copy link
Copy Markdown
Collaborator

Summary

  • add the Google ADK TinyFish package under google-adk/
  • expose SDK-backed function tools for web automation, queued runs, run lookup, search, fetch, and browser session creation
  • depend on tinyfish>=0.2.5 and remove the stale cancel tool from the public surface
  • add focused tests, scoped CI, and PyPI trusted-publishing workflow

Tests

  • make lint
  • make test
  • python3 -m build

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.
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 11, 2026

Review Change Stack
No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: e25fa1c7-7cf4-462a-8db6-9cc0fec9e67d

📥 Commits

Reviewing files that changed from the base of the PR and between 4e6e730 and 262c1d0.

📒 Files selected for processing (5)
  • .github/workflows/google-adk-ci.yml
  • google-adk/README.md
  • google-adk/requirements-dev.txt
  • google-adk/src/tinyfish_adk/tools.py
  • google-adk/tests/test_tools.py
✅ Files skipped from review due to trivial changes (2)
  • google-adk/README.md
  • google-adk/requirements-dev.txt
🚧 Files skipped from review as they are similar to previous changes (3)
  • .github/workflows/google-adk-ci.yml
  • google-adk/tests/test_tools.py
  • google-adk/src/tinyfish_adk/tools.py

📝 Walkthrough

Walkthrough

This PR introduces the tinyfish-adk package, a complete integration of TinyFish web automation capabilities into Google's Agent Development Kit. The package provides seven tool functions wrapped around the TinyFish SDK—synchronous web automation, async job submission, run status polling, run listing with filtering, web search, content fetching, and browser session creation. Each tool standardizes request parameters (browser profile selection with fallback, optional proxy configuration), handles SDK exceptions gracefully by converting them to error strings, and formats responses as JSON or human-readable text. The implementation includes full test coverage via pytest, CI/CD workflows for automated testing and PyPI publication on version tags, a developer Makefile for common tasks, and comprehensive README documentation with installation and usage examples.

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title 'Add Google ADK TinyFish integration' accurately summarizes the main objective: introducing a new Google ADK package that integrates TinyFish SDK-backed tool functions.
Description check ✅ Passed The description is directly related to the changeset, detailing the addition of the Google ADK TinyFish package, exposed tool functions, dependencies, tests, and CI workflows that align with the actual file changes.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch pranav/google-adk-sdk-tools

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 4

🧹 Nitpick comments (3)
google-adk/tests/test_tools.py (1)

44-49: ⚡ Quick win

Add 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 win

Pin 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 win

Add 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

📥 Commits

Reviewing files that changed from the base of the PR and between 23f22da and 4e6e730.

📒 Files selected for processing (10)
  • .github/workflows/google-adk-ci.yml
  • .github/workflows/google-adk-publish.yml
  • google-adk/.gitignore
  • google-adk/Makefile
  • google-adk/README.md
  • google-adk/pyproject.toml
  • google-adk/requirements-dev.txt
  • google-adk/src/tinyfish_adk/__init__.py
  • google-adk/src/tinyfish_adk/tools.py
  • google-adk/tests/test_tools.py

Comment thread google-adk/README.md
Comment thread google-adk/README.md Outdated
Comment thread google-adk/src/tinyfish_adk/tools.py Outdated
Comment thread google-adk/src/tinyfish_adk/tools.py
Return tool-friendly client initialization errors, validate run-list limits, support SDK data responses, fix README examples, and add CI build coverage.
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.

1 participant