1624318455/dsh-plugin-tavily5

@dsh-external/dsh-plugin-tavily

基于Tavily的专业网页搜索服务商插件

AI 分析

在WebUI中提供完整的Tavily搜索配置与状态检测,适合需要高质量联网搜索的用户。

套件
@dsh-external/dsh-plugin-tavily
版本
0.6.2
授權
MIT
最近更新
2026年9月12日

安裝

$npx -p @deepseek-ai/dsh dsh plugin --profile web add github:1624318455/dsh-plugin-tavily

🖥️ GUI usage (recommended for most users)

Open 设置 → 插件 → 网页搜索 and expand the Web search (Tavily) card.

  • Basic area (always visible):
    • Status indicator — a live badge (✅ normal / ⚠️ credits low / ✗ API error / no key) checked by the host with the stored key (GET /api/tavily-status, which reads Tavily GET /usage and costs no search credits); the Refresh button forces a re-check (auto-checks are throttled to once a minute).
    • Web search engineTavily (default; keyless if no key) or official DeepSeek. This is the real provider switch; the plugin is already elected as the provider.
    • API key — paste your Tavily key. It is stored through the credentials service, never in a settings file.
    • API Base URL — leave blank for https://api.tavily.com, or set a proxy/endpoint base.
    • Parameter preset — apply Deep research, Quick summary, or Live news in one click: several advanced fields are staged at once (yaml-pinned fields are skipped); press Save to apply.
    • Test API connection — verifies the key/base URL you just entered; failures are classified (invalid key / insufficient credits / rate limited / service down / timeout / network) with a targeted explanation. Testing consumes one Tavily search credit. If a key is already configured but you have not typed one, the card tells you to re-enter it once; the browser intentionally cannot read stored secrets back.
    • Estimated cost — a live line shows the estimated credits and rough token count for the current depth/result/chunk settings.
    • Check usage — reads Tavily GET /usage with the currently entered key and shows the remaining credits, search usage, and plan. Stored keys must be re-entered once, like the connectivity test.
  • Advanced area (🔧 Advanced Tavily request parameters):
    • Max results — how many web results per search (1–20, default 5).
    • Search depthbasic (balanced), advanced (2 credits, deep), fast, or ultra-fast (1 credit, lowest latency).
    • Topicgeneral, news, or finance.
    • Generated answertrue/basic (quick) or advanced (detailed).
    • Raw page contentfalse, markdown, or text; enabling greatly increases context token usage.
    • Chunks per source — snippet chunks per source (1–3).
    • Time range — recency preset (day/week/month/year/d/w/m/y).
    • Start date / End date — precise YYYY-MM-DD publish windows.
    • Include images / Image descriptions / Include favicon — request richer result metadata.
    • Include domains / Exclude domains — site allow/deny lists.
    • Country boost — bias toward one country (general topic).
    • Rate-limit retries — extra attempts (0–5) after a 429; waits honor retry-after with a bounded backoff.
    • Cache TTL (seconds) — cache identical searches to save credits; 0 disables (0–3600).
    • Cache max entries — LRU cap on cached searches (1–10000, default 200); the oldest entry evicts past it.
    • Skip cache for fresh queries — when on (default), news/finance searches and searches with a time window bypass the cache entirely.
    • Debug logging — one concise line per search/extract (query excerpt, credits, cache state, duration, errors); never the key or raw bodies.
    • Citation formatplain (answer only, default) or footnote (appends [1] title — url… numbered sources the model can cite).
    • Fallback enginenone (default) or DeepSeek (automatic): on a Tavily-side failure (timeout/network/5xx) the search is answered by the official DeepSeek provider.
    • Request timeout (ms) — default 30000.
    • Recency window (days) — optional recency filter for news/finance topics.

Every control has a short hint and a placeholder showing the default. Values are saved with the card's Save button and apply live; no service restart is needed.

If a field shows "Covered by config file; edit the yaml to change", it is pinned by cordis.patch.yml — the WebUI deliberately does not allow overriding it.

⚙️ Config-file usage (developer/pro users)

Configuration lives in your profile's cordis.patch.yml (~/.dsh/profiles/web/cordis.patch.yml). Add a web-search-tavily row with a config block:

- id: web-search-tavily
  name: '@dsh-external/dsh-plugin-tavily'
  config:
    searchDepth: advanced
    topic: news
    maxResults: 8
    includeRawContent: false
    timeout: 20000
    engine: tavily
    citeFormat: footnote          # numbered [1] title — url citations in the answer
    fallbackEngine: deepseek      # answer via DeepSeek on a Tavily-side outage
    apiKeyRefs:                   # multi-key rotation ring (credential refs only)
      - TAVILY_API_KEY_1
      - TAVILY_API_KEY_2

Priority

cordis.patch.yml config  >  WebUI card values  >  code defaults
  • If a key is present in the yaml config block, the card disables that field and shows the configuration-covered badge.
  • If the yaml does not set a field, the WebUI value (if any) is used.
  • If neither sets it, the code default applies.

Settings table

KeyDefaultMeaningGUI editable
apiKeyunsetliteral Tavily API key; prefer the credentials store insteadkey field (via credentials)
apiKeyEnvTAVILY_API_KEYcredential reference / environment key the provider resolves per searchconfig only
apiKeyRefs[]extra credential references for the multi-key rotation ring (refs only; keys stay in the credentials store/env)config only
baseURLhttps://api.tavily.comendpoint base, /search appended
maxResults5default number of web results per search (1–20)
searchDepthbasicbasic/advanced/fast/ultra-fast
topicgeneralgeneral, news, or finance
includeAnswertruegenerated answer: true/basic (quick) or advanced (detailed)
includeRawContentfalseraw page content: false, markdown, or text (context-heavy)
chunksPerSource3snippet chunks per source (1–3)
timeRangeunsetrecency preset: day/week/month/year/d/w/m/y
timeout30000request timeout in milliseconds
enginetavilyengine answering web_search: tavily (keyless if no key) or deepseek
citeFormatplainanswer/source layout: plain or footnote (numbered citations)
fallbackEnginenoneon a Tavily-side failure (timeout/network/5xx), answer via deepseek
daysunsetrecency window in days (news/finance topics)
retryMaxAttempts2extra attempts after a 429 (0–5)
cacheTtlSeconds0query-cache TTL in seconds (0 disables)
cacheMaxEntries200LRU cap on cached searches (1–10000)
cacheBypassFreshtrueskip the cache for news/finance or time-windowed searches
cacheFileunsetJSON file the result cache persists to (survives restarts); unset/empty disablesconfig only
debugfalseconcise per-search debug logging (never the key/raw bodies)
firecrawlBaseURLhttps://api.firecrawl.dev/v1Firecrawl fetch provider endpoint base (/scrape appended)config only
firecrawlApiKeyunsetliteral Firecrawl API key; prefer the credential referenceconfig only
firecrawlApiKeyEnvFIRECRAWL_API_KEYFirecrawl credential reference resolved per fetchconfig only
startDateunsetinclude results after this YYYY-MM-DD
endDateunsetinclude results before this YYYY-MM-DD
includeImagesfalsecollect query-related and per-source images
includeImageDescriptionsfalseadd a description per image
includeFaviconfalseinclude the favicon URL per result
includeDomains[]only include these domains (allow list)
excludeDomains[]exclude these domains (deny list)
countryunsetboost results from one country (general topic)
numResults5deprecated alias for maxResultsno (use maxResults)

apiKeyEnv stays config-only deliberately: it is an advanced wiring detail. Values saved from the GUI land in ~/.dsh/settings.yaml's web-search-tavily section. Settings edits apply live — the provider re-reads the section for every operation, so no restart or re-registration is needed after changing a value from the card or the file.