From d9e5e56bca5a6c6b455e6cabae0362b6c6ee2b5e Mon Sep 17 00:00:00 2001 From: Anurag Date: Wed, 12 Feb 2025 15:47:07 -0500 Subject: [PATCH] Add optional parameter to pass custom api url in firecrawl (#2097) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Description Add optional parameter to pass custom api url in firecrawl Fixed #2093 --- ## Type of change Please check the options that are relevant: - [ ] Bug fix (non-breaking change which fixes an issue) - [x] New feature (non-breaking change which adds functionality) - [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected) - [ ] Model update (Addition or modification of models) - [ ] Other (please describe): --- ## Checklist - [x] Adherence to standards: Code complies with Agno’s style guidelines and best practices. - [x] Formatting and validation: You have run `./scripts/format.sh` and `./scripts/validate.sh` to ensure code is formatted and linted. - [x] Self-review completed: A thorough review has been performed by the contributor(s). - [ ] Documentation: Docstrings and comments have been added or updated for any complex logic. - [ ] Examples and guides: Relevant cookbook examples have been included or updated (if applicable). - [ ] Tested in a clean environment: Changes have been tested in a clean environment to confirm expected behavior. - [ ] Tests (optional): Tests have been added or updated to cover any new or changed functionality. --- --- libs/agno/agno/tools/firecrawl.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libs/agno/agno/tools/firecrawl.py b/libs/agno/agno/tools/firecrawl.py index b0bdae52c..5e2b4ee84 100644 --- a/libs/agno/agno/tools/firecrawl.py +++ b/libs/agno/agno/tools/firecrawl.py @@ -19,6 +19,7 @@ def __init__( limit: int = 10, scrape: bool = True, crawl: bool = False, + api_url: Optional[str] = "https://api.firecrawl.dev", ): super().__init__(name="firecrawl_tools") @@ -28,7 +29,7 @@ def __init__( self.formats: Optional[List[str]] = formats self.limit: int = limit - self.app: FirecrawlApp = FirecrawlApp(api_key=self.api_key) + self.app: FirecrawlApp = FirecrawlApp(api_key=self.api_key, api_url=api_url) # Start with scrape by default. But if crawl is set, then set scrape to False. if crawl: