feat: migrate google_news action to support Tavily as parallel source - #2
Conversation
|
Thanks for the PRs, and for the detail in the write-ups. I'm going to pass on these, and I want to be straight about why. Bah's main constraint is that it has to work for someone who just downloads the installer and opens it — no signup, no API key. These PRs read As they stand, the three PRs also each register the same If Tavily ever has a keyless tier that works with no signup, I'd genuinely be interested — that's the bar for anything that ships in the default experience here. |
Summary
Adds Tavily as a configurable parallel news search source for the
google_newsaction, running alongside the existing Google News DOM scrape. WhenTAVILY_API_KEYis set, structured news results from Tavily are fetched in parallel and merged with Google scrape results for richer coverage. The existing Google News path remains fully intact as the fallback.Changes
New IPC handler (
src/main/main.ts)tavily:searchIPC handler that calls the Tavily search API withtopic: 'news'usingTAVILY_API_KEYfrom environment variablesPreload bridge (
src/preload/preload.ts)tavilySearch()method to the renderer viacontextBridgeRenderer (
src/renderer/App.tsx)tavilySearchtype to theelectronAPIinterfacegoogle_newshandler to fire Tavily search in parallel with Google scrapeAI prompt (
src/main/ai-engine.ts)google_newsaction description to mention Tavily as an optional parallel sourceFiles changed
package.jsonsrc/main/main.tssrc/preload/preload.tssrc/renderer/App.tsxsrc/main/ai-engine.tsDependency changes
@tavily/core^0.0.7 todependenciesEnvironment variable changes
TAVILY_API_KEY— read by thetavily:searchIPC handler in main.ts. Optional; when not set, the existing Google News scrape path is used exclusively.Notes for reviewers
TAVILY_API_KEYis present and the API call succeeds@tavily/corepackage is lazy-loaded viarequire()inside the handler to avoid startup cost when unusedAutomated Review