Skip to content

feat: enhance serper tool full api#6540

Open
LarsEbt wants to merge 4 commits into
FlowiseAI:mainfrom
LarsEbt:feature/enhance-serper-tool-full-api
Open

feat: enhance serper tool full api#6540
LarsEbt wants to merge 4 commits into
FlowiseAI:mainfrom
LarsEbt:feature/enhance-serper-tool-full-api

Conversation

@LarsEbt

@LarsEbt LarsEbt commented Jun 22, 2026

Copy link
Copy Markdown

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

  • 11 endpoints selectable via dropdown: Web Search, News, Images, Videos, Places, Maps, Shopping, Scholar, Patents, Autocomplete, Web Scrape
  • 10 optional parameters (hidden under Additional Parameters to keep UI clean):
    • gl — Country code (e.g. us, de)
    • hl — Language code (e.g. en, de)
    • num — Number of results (1–100)
    • page — Pagination
    • tbs — Time filter using Google's internal tbs syntax (qdr:w, custom date ranges, supports {variables})
    • location — Geographic location string
    • autocorrect — Enable/disable query autocorrection
    • imgar — Image aspect ratio filter (Images endpoint)
    • imgtype — Image type filter: photo, face, clipart, lineart, animated (Images endpoint)
    • ll — Map coordinates (Maps endpoint)
  • Backward compatible — existing chatflows using v1.0 continue to work, all new params are optional with safe defaults
  • No new dependencies — uses node-fetch already present in the package
  • Tests — comprehensive test suite covering all endpoints, parameters, response parsing, and error handling

Implementation

Follows the same node.ts + core.ts pattern used by Arxiv, Gmail, and other tools in this codebase. The SerperTool extends LangChain's Tool class directly.

LarsEbt and others added 2 commits June 22, 2026 13:56
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>
@LarsEbt LarsEbt changed the title Feature/enhance-serper-tool-full-api Feature/enhance serper tool full api Jun 22, 2026

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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.

Comment thread packages/components/nodes/tools/Serper/core.ts
Comment thread packages/components/nodes/tools/Serper/core.ts
@LarsEbt LarsEbt changed the title Feature/enhance serper tool full api feat: enhance serper tool full api Jun 22, 2026
LarsEbt and others added 2 commits June 22, 2026 14:21
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>
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.

Enhance Serper tool to support all Serper.dev API endpoints and parameters

1 participant