core/config: default the local search to DeepSeek only

This commit is contained in:
2026-10-17 17:06:56 +08:00
parent cfe36b024b
commit 9742a1ae7a
2 changed files with 9 additions and 8 deletions
+8 -7
View File
@@ -392,10 +392,10 @@ def _default_deepseek_models() -> dict[str, ModelConfig]:
def _default_deepseek_search_sources() -> list[SearchSource]: def _default_deepseek_search_sources() -> list[SearchSource]:
"""Sources for the local ``web_search`` tool, in fallback order. """Sources for the local ``web_search`` tool, in fallback order.
DeepSeek's own index (the platform Search API) first, Bing's RSS as the DeepSeek's own index (the platform Search API) is the default. Bing's RSS is
backstop when a search fails or finds nothing. a brittle, SEO-heavy backstop: list ``"bing"`` explicitly to opt in.
""" """
return ["deepseek", "bing"] return ["deepseek"]
class DeepseekProvider(ProviderConfig, tag="deepseek"): class DeepseekProvider(ProviderConfig, tag="deepseek"):
@@ -411,10 +411,11 @@ class DeepseekProvider(ProviderConfig, tag="deepseek"):
disables the hosted one). DeepSeek hosts a search only on the Anthropic disables the hosted one). DeepSeek hosts a search only on the Anthropic
surface; every other convention gets a local ``web_search`` tool instead surface; every other convention gets a local ``web_search`` tool instead
(see ``config.routing.local_web_search``). ``search_sources`` names what (see ``config.routing.local_web_search``). ``search_sources`` names what
that local tool searches with, in fallback order — ``["deepseek", "bing"]`` that local tool searches with, in fallback order — ``["deepseek"]`` by
by default (the platform Search API, then Bing's RSS), ``[]`` to not offer default (the platform Search API), ``[]`` to not offer it. ``"bing"`` adds
it. The two settings are independent: turning hosted tools off on the Bing's RSS as an opt-in backstop. The two settings are independent: turning
Anthropic convention leaves the local Search API tool in place. hosted tools off on the Anthropic convention leaves the local Search API tool
in place.
``extras`` keeps arbitrary provider keys; the legacy ``extras.convention`` ``extras`` keeps arbitrary provider keys; the legacy ``extras.convention``
key is parsed but ignored (prefer the typed ``convention`` field). key is parsed but ignored (prefer the typed ``convention`` field).
+1 -1
View File
@@ -61,7 +61,7 @@ def test_without_search_sources_there_is_no_local_tool() -> None:
# for a search (the hosted path on the Anthropic convention is unaffected). # for a search (the hosted path on the Anthropic convention is unaffected).
assert _effective(convention="responses", sources=[]).search_sources == [] assert _effective(convention="responses", sources=[]).search_sources == []
assert local_web_search(_effective(convention="responses", sources=[])) is False assert local_web_search(_effective(convention="responses", sources=[])) is False
assert _effective(convention="responses").search_sources == ["deepseek", "bing"] assert _effective(convention="responses").search_sources == ["deepseek"]
def test_api_base_url_drops_the_convention_and_version_paths() -> None: def test_api_base_url_drops_the_convention_and_version_paths() -> None: