feat: add Tavily Extract as parallel scraping option alongside Firecrawl#29
Open
tavily-integrations wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds Tavily Extract as a configurable page content extraction option alongside the existing Firecrawl provider. When
TAVILY_API_KEYis set, Tavily Extract is tried first for page scraping, with Firecrawl as secondary fallback and the simple requests-based scraper as tertiary fallback.Why: Tavily Extract provides an alternative content extraction API that can improve reliability and reduce dependency on a single scraping provider.
Changes
engine/utils/tavily_extract_client.py(new):TavilyExtractClientwrappingTavilyClient.extract(), returning the same{success, content, url, metadata}dict asFirecrawlClient.scrape_url()engine/utils/fallback_services.py: Addedscrape_page_with_tavily()function; updatedscrape_page_with_firecrawl()to attempt Tavily Extract first whenTAVILY_API_KEYis setengine/requirements.txt: Addedtavily-python>=0.5.0.env.example: DocumentedTAVILY_API_KEY(also enables Extract)Dependency changes
tavily-python>=0.5.0toengine/requirements.txtEnvironment variable changes
TAVILY_API_KEY: When set, enables Tavily Extract as the primary page scraping method (also used for web search if that migration unit is applied)Notes for reviewers
FIRECRAWL_API_KEYremain fully functional and unchangedTAVILY_API_KEYis present in the environmentTavilyExtractClientgracefully handles missingtavily-pythonpackage via ImportErrorAutomated Review