From 29d0023fcadf7fecd595f32f999d8e9b83392e8c Mon Sep 17 00:00:00 2001 From: chengyongru Date: Fri, 30 Oct 2026 17:29:45 +0800 Subject: [PATCH] fix(tools): correct DeepSeek Search rate-limit guidance Remove stale quota details from the 429 diagnostic and configuration guide. Point users to DeepSeek for current account limits. Co-authored-by: chengyongru <61816729+chengyongru@users.noreply.github.com> --- docs/configuration.md | 2 +- nanobot/agent/tools/web.py | 4 ++-- tests/tools/test_web_search_tool.py | 5 +++++ 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/docs/configuration.md b/docs/configuration.md index eda37d498..95bcf3380 100644 --- a/docs/configuration.md +++ b/docs/configuration.md @@ -2117,7 +2117,7 @@ AnySearch works out of the box with no key, via its anonymous quota (lower rate Create a key at [platform.deepseek.com](https://platform.deepseek.com). Set `tools.web.search.apiKey` directly or with a `${VAR_NAME}` reference. Missing credentials cause a configuration error, with no provider fallback. -Queries are limited to 128 Unicode characters after trimming whitespace; longer queries are rejected. Pricing is ¥5 per 1,000 successful requests, with an account-wide limit of 5 QPS across API keys. See the [DeepSeek Search API documentation](https://api-docs.deepseek.com/zh-cn/guides/search/) for search syntax and billing details. +Queries are limited to 128 Unicode characters after trimming whitespace; longer queries are rejected. See the [DeepSeek Search API documentation](https://api-docs.deepseek.com/zh-cn/guides/search/) for search syntax, pricing, and account-wide rate limits. #### `tools.web.search` diff --git a/nanobot/agent/tools/web.py b/nanobot/agent/tools/web.py index e7ca4bb99..ac8ff96ca 100644 --- a/nanobot/agent/tools/web.py +++ b/nanobot/agent/tools/web.py @@ -972,8 +972,8 @@ class WebSearchTool(Tool): ) if r.status_code == 429: return ToolResult.error( - "Error: DeepSeek search rate limited after retry. The account " - "limit is 5 QPS; retry later or reduce the frequency of concurrent web_search calls." + "Error: DeepSeek search rate limited after retry. " + "Retry later or reduce the frequency of concurrent web_search calls." ) if _deepseek_is_retryable(r.status_code): return ToolResult.error( diff --git a/tests/tools/test_web_search_tool.py b/tests/tools/test_web_search_tool.py index 1eee4aac1..425212949 100644 --- a/tests/tools/test_web_search_tool.py +++ b/tests/tools/test_web_search_tool.py @@ -733,6 +733,11 @@ async def test_deepseek_search_gives_up_after_retry_budget( assert is_tool_error_result(result) assert expected_text in result assert "after retry" in result + if status == 429: + assert result == ( + "Error: DeepSeek search rate limited after retry. " + "Retry later or reduce the frequency of concurrent web_search calls." + ) @pytest.mark.asyncio