feat: enhance serper tool full api#6540
Conversation
Upgrades the existing Serper node from a minimal wrapper to a full-featured Google Search API tool while preserving backward compatibility. Changes: - Add Search Endpoint selector: Web Search, News, Images, Videos, Places, Maps, Shopping, Scholar, Patents, Autocomplete, Web Scrape (11 endpoints) - Add optional params: Country (gl), Language (hl), Number of Results (num), Page, Time Filter (tbs), Location, Autocorrect, Image Aspect Ratio (imgar), Image Type (imgtype), Maps Coordinates (ll) - tbs uses Google's internal tbs syntax (supports presets qdr:h/d/w/m/y and custom date ranges cdr:1,cd_min:MM/DD/YYYY,cd_max:MM/DD/YYYY) - Replace LangChain Serper wrapper with custom HTTP client hitting Serper API directly (native fetch, no additional dependencies) - Rich response parsing: answerBox > sportsResults > knowledgeGraph > typed arrays - All optional params are hidden under Additional Parameters to keep UI clean - Version bumped to 2.0; existing chatflows using v1.0 continue to work (all new params are optional with safe defaults) - Add comprehensive test suite (60+ tests covering all endpoints, params, response parsing, and error handling) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…Flowise codebase Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Code Review
This pull request upgrades the Serper tool to version 2.0 by replacing the external LangChain Serper dependency with a custom, feature-rich SerperTool implementation. This new implementation supports all 11 Serper.dev endpoints and exposes advanced configuration parameters (such as localization, pagination, and filters) as node inputs, accompanied by a comprehensive test suite. The review feedback recommends adding nullish checks on the parsed API JSON responses to prevent potential runtime crashes and ensure robust error handling.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Summary
The existing Serper node only supported a single Google Web Search endpoint with no configuration options. This PR upgrades it to expose the full Serper.dev API directly from the Flowise UI.
Closes #6541
Changes
gl— Country code (e.g.us,de)hl— Language code (e.g.en,de)num— Number of results (1–100)page— Paginationtbs— Time filter using Google's internal tbs syntax (qdr:w, custom date ranges, supports{variables})location— Geographic location stringautocorrect— Enable/disable query autocorrectionimgar— Image aspect ratio filter (Images endpoint)imgtype— Image type filter: photo, face, clipart, lineart, animated (Images endpoint)ll— Map coordinates (Maps endpoint)node-fetchalready present in the packageImplementation
Follows the same
node.ts+core.tspattern used by Arxiv, Gmail, and other tools in this codebase. TheSerperToolextends LangChain'sToolclass directly.