1 Commits

Author SHA1 Message Date
evan188199-tech
1a9c006a2d feat(web_fetch): pluggable fetch backend with DeepSeek Fetch as first alternative (#2448)
Add a FETCH_PROVIDERS spec table next to SEARCH_PROVIDERS and a
deeptutor/services/fetch/providers registry, mirroring the search-provider
shape: local (the unchanged in-process extractor, default) and deepseek
(POST /v1/tools/fetch, Bearer auth; key from kwargs > env > DeepSeek chat
profile).

fetch_url_as_markdown gains backend=None -> DEEPTUTOR_FETCH_BACKEND ->
local. The scheme/SSRF gate runs before any remote backend so a private
URL is never handed to a third party. Retryable backend failures
(401/402/403/408/429/5xx, network, missing key) fall back to the local
extractor; 400/404/413 and an empty body are hard failures. Remote
outcomes keep the requested URL for citations; the crawler/KB site sync
stay local. All tests mock HTTP offline.
2026-11-09 12:53:31 +08:00