Skip to content

✨Feature: Add Serply search tool - #3749

Open
googio wants to merge 1 commit into
ModelEngine-Group:developfrom
googio:feat/serply-search
Open

✨Feature: Add Serply search tool#3749
googio wants to merge 1 commit into
ModelEngine-Group:developfrom
googio:feat/serply-search

Conversation

@googio

@googio googio commented Aug 22, 2026

Copy link
Copy Markdown

What

Adds SerplySearchTool, a web search tool backed by the Serply SERP API, as another interchangeable option alongside TavilySearchTool, ExaSearchTool, and LinkupSearchTool. It returns Google organic results with title, snippet, and link, and emits the same observer messages and SearchResultTextMessage card format as the existing search tools.

Why

Closes #3748. The SDK's search-tool family has no Google SERP option today; users who need Google-flavored results, or who already hold a Serply subscription, cannot bring their key to Nexent.

Notes

  • Serply support is optional, and behavior is unchanged when no Serply API key is configured.
  • Mirrors TavilySearchTool in sdk/nexent/core/tools/tavily_search_tool.py: same Tool subclass shape, observer hooks, and running-prompt messages (en/zh).
  • Registered through the standard three touch points: export in sdk/nexent/core/tools/__init__.py, ToolSign.SERPLY_SEARCH in sdk/nexent/core/utils/tools_common_message.py, and a label entry in backend/consts/tool_labels.py.
  • No new dependency: uses httpx, which the SDK already depends on. The request sends an explicit User-Agent because the Serply API rejects default client user agents.
  • Tests added in test/sdk/core/tools/test_serply_search_tool.py with the network mocked.
  • Serply API docs: https://serply.io/docs

Testing

$ python -m pytest test/sdk/core/tools/test_serply_search_tool.py -v
test/sdk/core/tools/test_serply_search_tool.py::test_forward_with_results PASSED [ 25%]
test/sdk/core/tools/test_serply_search_tool.py::test_forward_no_results PASSED [ 50%]
test/sdk/core/tools/test_serply_search_tool.py::test_forward_without_observer PASSED [ 75%]
test/sdk/core/tools/test_serply_search_tool.py::test_forward_http_error PASSED [100%]
============================== 4 passed in 1.02s ===============================

Also live-tested against the real API with a personal key:

>>> tool = SerplySearchTool(serply_api_key=..., observer=MessageObserver(), max_results=3)
>>> tool.forward("nexent agent platform")
[{"title": "Nexent is a zero-code platform for auto-generating ... - GitHub",
  "text": "Nexent is a zero-code platform for auto-generating production-grade AI agents, ...",
  "index": "o1"}, ...]

Disclosure: I work with Serply. Happy to adjust scope, naming, or drop this entirely if it isn't a direction you want for the project.

Adds SerplySearchTool as a new open-web search provider alongside
tavily/exa/linkup, using Serply's REST search API (api.serply.io).
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.

[Request] Add Serply as a web search tool option

1 participant