Skip to content

✨Feature: Add Serply search tool - #3749

Open
googio wants to merge 2 commits into
ModelEngine-Group:developfrom
googio:feat/serply-search
Open

googio wants to merge 2 commits 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).
@codecov

codecov Bot commented Aug 27, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 90.16393% with 6 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
sdk/nexent/core/tools/serply_search_tool.py 89.83% 5 Missing and 1 partial ⚠️

📢 Thoughts on this report? Let us know!

@googio

googio commented Aug 28, 2026

Copy link
Copy Markdown
Author

A note on the Codecov report above, since as it stands it reads as an unaddressed coverage failure.

That comment was created at 2026-08-27 01:51:15 UTC and has not been edited since. The coverage commit fe5d29087 landed at 02:08:08 UTC, about 17 minutes later, and Codecov has not re-run on the current head. So the 90.16% patch figure describes d30f08d10 on its own, before the tests that were added to answer it.

Measured locally on the current head fe5d29087:

$ pytest test/sdk/core/tools/test_serply_search_tool.py -q \
    --cov=sdk.nexent.core.tools.serply_search_tool --cov-report=term-missing

Name                                          Stmts   Miss  Cover   Missing
---------------------------------------------------------------------------
sdk/nexent/core/tools/serply_search_tool.py      59      0   100%
---------------------------------------------------------------------------
TOTAL                                            59      0   100%
7 passed in 2.84s

serply_search_tool.py is the one file the report lists under missing lines, at 89.83%. It is at 100% on the current head, with the error branches the report flagged covered explicitly.

Re-triggering Codecov should refresh the report; I cannot do that from here. If anything still comes back short after it re-runs, I am glad to add coverage.

@googio

googio commented Sep 5, 2026

Copy link
Copy Markdown
Author

@Dallas98 @WMC001 @jeffwu-1999 Gentle ping on this one, two weeks in. The branch is still conflict-free against develop, and the Codecov comment above predates the coverage commit (the tool file is at 100% on the current head, details in my earlier comment).

The fork workflows on the current head are waiting for an approve-and-run from a maintainer. If the tool should live somewhere else, needs a different ToolSign letter, or you would rather I rebase onto the latest develop first, tell me and I will turn it around quickly.

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