Skip to content

Add TinyFish search and fetch tools#2820

Open
pranavjana wants to merge 3 commits into
ag2ai:mainfrom
pranavjana:feat/add-tinyfish-search-fetch
Open

Add TinyFish search and fetch tools#2820
pranavjana wants to merge 3 commits into
ag2ai:mainfrom
pranavjana:feat/add-tinyfish-search-fetch

Conversation

@pranavjana
Copy link
Copy Markdown

Summary

This PR expands the TinyFish integration so AG2 agents can use all three TinyFish web APIs that are useful in agent workflows:

  • TinyFishTool for goal-directed Agent API automation on a target URL
  • TinyFishSearchTool for ranked web search results in the existing autogen.tools.experimental API
  • TinyFishFetchTool for browser-rendered content extraction from known URLs in the existing autogen.tools.experimental API
  • TinyFishSearchToolkit for beta agents, exposing both tinyfish_search and tinyfish_fetch

The main use case is a research workflow where an agent first discovers candidate pages with Search, then reads selected pages with Fetch, and can still use the existing goal-directed TinyFish Agent API when it needs TinyFish to operate a website from a natural-language goal.

Changes

  • Adds autogen.beta.tools.search.TinyFishSearchToolkit with structured search and fetch result dataclasses.
  • Re-exports the beta toolkit from autogen.beta.tools.search and autogen.beta.tools with the existing optional-dependency fallback pattern.
  • Adds TinyFishSearchTool and TinyFishFetchTool to autogen.tools.experimental.tinyfish, alongside the existing TinyFishTool.
  • Updates experimental exports so the new tools can be imported from autogen.tools.experimental and autogen.tools.experimental.tinyfish.
  • Adds tinyfish to the docs/search optional extras groups.
  • Extends existing TinyFish reference docs to cover Agent, Search, and Fetch, and adds beta toolkit docs under common toolkits.

Validation

  • git diff --check
  • uv run ruff format --check autogen/tools/experimental/tinyfish/tinyfish_tool.py autogen/beta/tools/search/tinyfish.py test/tools/experimental/tinyfish/test_tinyfish.py test/beta/tools/search/test_tinyfish.py
  • uv run ruff check autogen/tools/experimental/tinyfish/tinyfish_tool.py autogen/beta/tools/search/tinyfish.py test/tools/experimental/tinyfish/test_tinyfish.py test/beta/tools/search/test_tinyfish.py
  • uv run --extra tinyfish --extra tavily --extra exa --extra ddgs --extra perplexity pytest test/beta/tools/search test/tools/experimental/tinyfish/test_tinyfish.py -q

The pytest run passed with 99 passed.

Documentation

Docs were updated in:

  • website/docs/user-guide/reference-tools/tinyfish.mdx
  • website/docs/user-guide/reference-tools/index.mdx
  • website/docs/beta/tools/common_toolkits.mdx

I attempted the local docs build with the docs extra, but this environment is missing Quarto, so notebook metadata generation fails before the docs site can complete building.

@pranavjana pranavjana requested a review from Lancetnik as a code owner May 14, 2026 08:35
@CLAassistant
Copy link
Copy Markdown

CLAassistant commented May 14, 2026

CLA assistant check
All committers have signed the CLA.

@github-actions github-actions Bot added documentation Improvements or additions to documentation dependencies Pull requests that update a dependency file beta labels May 14, 2026
@codecov
Copy link
Copy Markdown

codecov Bot commented May 14, 2026

Codecov Report

❌ Patch coverage is 84.24658% with 23 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
...togen/tools/experimental/tinyfish/tinyfish_tool.py 66.66% 15 Missing and 2 partials ⚠️
autogen/beta/tools/search/tinyfish.py 93.10% 3 Missing and 3 partials ⚠️
Files with missing lines Coverage Δ
autogen/beta/tools/__init__.py 100.00% <100.00%> (ø)
autogen/beta/tools/search/__init__.py 63.63% <100.00%> (+8.08%) ⬆️
autogen/tools/experimental/__init__.py 100.00% <100.00%> (ø)
autogen/tools/experimental/tinyfish/__init__.py 100.00% <100.00%> (ø)
autogen/beta/tools/search/tinyfish.py 93.10% <93.10%> (ø)
...togen/tools/experimental/tinyfish/tinyfish_tool.py 70.00% <66.66%> (-2.50%) ⬇️

... and 49 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@pranavjana
Copy link
Copy Markdown
Author

pranavjana commented May 14, 2026

Addressed the Codecov patch coverage feedback with focused tests for both TinyFish implementations:

  • beta TinyFishSearchToolkit client option forwarding and fetch link fallback behavior
  • legacy TinyFishTool / TinyFishSearchTool / TinyFishFetchTool SDK response mapping helpers, including close calls and Agent API result branches

Validation after the update:

git diff --check
uv run ruff check test/tools/experimental/tinyfish/test_tinyfish.py test/beta/tools/search/test_tinyfish.py
uv run --extra tinyfish --extra tavily --extra exa --extra ddgs --extra perplexity pytest test/beta/tools/search test/tools/experimental/tinyfish/test_tinyfish.py -q

Result: 107 passed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

beta dependencies Pull requests that update a dependency file documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants