Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@dcieslak19973
Copy link
Contributor

Why are these changes needed?

Add FireCrawl as a web search and URL scraping tool

Related issue number

Closes #1905

Checks

- Cast API return values to dict[str, Any] to satisfy return type annotations
- Fix Optional parameter passing by providing fallback values
- Update test calls to include required firecrawl_api_key and firecrawl_api_url parameters
- All mypy errors resolved and pre-commit hooks pass
- Fixed test mocking to use _execute_firecrawl_* functions instead of FirecrawlApp
- Fixed mypy type errors by casting FirecrawlApp return values to dict[str, Any]
- Fixed Optional parameter passing to underlying functions
- All tests now pass (12 passed, 2 skipped)
- All mypy type checks pass
@Copilot Copilot AI review requested due to automatic review settings June 22, 2025 04:07
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Adds the Firecrawl web scraping and crawling tool to the AG2 framework, including code integration, documentation, tests, and example notebooks.

  • Registers FirecrawlTool in the core API and WebSurferAgent
  • Provides user-guide docs and API reference for Firecrawl
  • Adds unit tests and example notebooks for Firecrawl usage

Reviewed Changes

Copilot reviewed 9 out of 10 changed files in this pull request and generated no comments.

Show a summary per file
File Description
website/docs/user-guide/reference-tools/index.mdx Adds Firecrawl section to tools index
website/docs/user-guide/reference-tools/firecrawl.mdx New detailed Firecrawl tool documentation
autogen/tools/experimental/firecrawl/init.py Introduces FirecrawlTool module
autogen/tools/experimental/init.py Exposes FirecrawlTool in experimental tools
autogen/agents/experimental/websurfer/websurfer.py Integrates FirecrawlTool into WebSurferAgent
test/tools/experimental/firecrawl/test_firecrawl.py Adds unit tests for FirecrawlTool
test/agents/experimental/websurfer/test_websurfer.py Updates WebSurferAgent tests to include firecrawl
notebook/websurfer_firecrawl_example.ipynb Example notebook for WebSurferAgent+Firecrawl
notebook/tools_firecrawl.ipynb Example notebook for FirecrawlTool
Comments suppressed due to low confidence (3)

website/docs/user-guide/reference-tools/firecrawl.mdx:98

  • Clarify in the URL Mapping section that map() returns a list of dictionaries each containing 'url', 'title', and 'content' (title/content may be empty), rather than just raw URLs.
### URL Mapping

website/docs/user-guide/reference-tools/firecrawl.mdx:76

  • Mention that crawl() also accepts optional override parameters firecrawl_api_key and firecrawl_api_url so users know how to switch endpoints at runtime.
### Website Crawling

notebook/websurfer_firecrawl_example.ipynb:96

  • Remove or correct entries ('Search' and 'Deep Research') under Available Firecrawl Methods since FirecrawlTool only supports scrape, crawl, and map.
    "4. **Search**: Search the web for content\n",

Copy link
Collaborator

@qingyun-wu qingyun-wu left a comment

Choose a reason for hiding this comment

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

LGTM!

@qingyun-wu qingyun-wu added this pull request to the merge queue Jun 22, 2025
Merged via the queue into ag2ai:main with commit 2d686dc Jun 22, 2025
12 checks passed
@codecov
Copy link

codecov bot commented Jun 22, 2025

Codecov Report

Attention: Patch coverage is 52.63158% with 63 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
...gen/tools/experimental/firecrawl/firecrawl_tool.py 52.34% 58 Missing and 3 partials ⚠️
autogen/agents/experimental/websurfer/websurfer.py 0.00% 2 Missing ⚠️

❗ There is a different number of reports uploaded between BASE (a39360e) and HEAD (3d95d80). Click for more details.

HEAD has 2601 uploads less than BASE
Flag BASE (a39360e) HEAD (3d95d80)
3.9 172 0
ubuntu-latest 260 1
commsagent-discord 18 0
optional-deps 350 0
3.10 212 0
commsagent-telegram 18 0
commsagent-slack 18 0
3.13 188 0
browser-use 6 0
core-without-llm 28 1
3.11 96 1
3.12 72 0
macos-latest 230 0
jupyter-executor 18 0
windows-latest 250 0
twilio 18 0
crawl4ai 18 0
interop 18 0
graph-rag-falkor-db 12 0
retrievechat 30 0
retrievechat-qdrant 28 0
retrievechat-pgvector 20 0
interop-crewai 18 0
interop-pydantic-ai 18 0
docs 12 0
interop-langchain 18 0
retrievechat-mongodb 20 0
rag 14 0
agent-eval 2 0
gpt-assistant-agent 6 0
retrievechat-couchbase 6 0
teachable 6 0
ollama 28 0
websurfer 30 0
wikipedia-api 18 0
mcp 18 0
websockets 18 0
google-api 18 0
bedrock 28 0
gemini 28 0
llama-index-agent 6 0
mistral 28 0
together 28 0
lmm 6 0
groq 28 0
swarm 28 0
long-context 6 0
cohere 30 0
anthropic 30 0
cerebras 28 0
Files with missing lines Coverage Δ
autogen/tools/experimental/__init__.py 100.00% <100.00%> (ø)
autogen/tools/experimental/firecrawl/__init__.py 100.00% <100.00%> (ø)
autogen/agents/experimental/websurfer/websurfer.py 33.33% <0.00%> (-2.39%) ⬇️
...gen/tools/experimental/firecrawl/firecrawl_tool.py 52.34% <52.34%> (ø)

... and 58 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.

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.

[Feature Request]: Firecrawl Search Tool

2 participants