Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update firecrawl toolkit with map, crawl status check, async crawl methods #1357

Closed
wants to merge 0 commits into from

Conversation

AbhishekRP2002
Copy link

changes implemented:

  • added method map_website for mapping functionality via firecrawl python sdk
  • added api_url in the Toolkit sub-class initialization attributes, since firecrawl allows self-hosting service.
  • added some checks for response formats attributes in crawl_website, scrape_website, and async_crawl_website method - ( avoid making an additional request to firecrawl if invalid output format )
  • separated the limit param into crawl_limit & map_limit to avoid incosistency in response fetching since both the params serve different purpose.
    crawl_limit - maximum number of webpages to include in crawling
    map_limit - maximum number of web URLs to return.

This PR aims to close #1349

Comment on lines 30 to 31
self.api_key: Optional[str] = api_key or os.getenv("FIRECRAWL_API_KEY")
self.api_url: Optional[str] = api_url or os.getenv("FIRECRAWL_API_URL", "https://api.firecrawl.dev")
Copy link
Contributor

Choose a reason for hiding this comment

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

Add an if condition to check if API key is available. If not then raise an error

Copy link
Author

Choose a reason for hiding this comment

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

I noticed in other tools implementation, rather than raise, logger.error was used and within the methods of the ToolKit also I noticed return rather than raise if api_key is not available. this makes me believe the parent components using tools like Assistant class does not handle exception classes ?
If this is the case, I will make some minor changes at my end in the script as well.
Pls correct me if I am wrong or if I am missing here something. @manthanguptaa

@AbhishekRP2002
Copy link
Author

Screenshot 2024-11-04 at 9 51 41 PM Screenshot 2024-11-04 at 9 51 49 PM Screenshot 2024-11-04 at 9 51 53 PM

sharing the results screenshot.

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.

Update Firecrawl tool with Async Crawling and Map functionality.
3 participants