feat: support for anthropic web_search - #6593
Open
seankhliao wants to merge 1 commit into
Open
Conversation
Adds support for calling web_search via the provider. Example provider config, using DeepSeek's support for the web_search tool: ```toml [[providers]] name = "anthropic-api-deepseek-com" kind = "anthropic" base_url = "https://api.deepseek.com/anthropic" models = ["deepseek-v4-flash", "deepseek-v4-pro"] api_key_env = "DEEPSEEK_API_KEY" context_window = 128000 # tokens; compaction triggers near this limit prices = { "deepseek-v4-flash" = { cache_hit = 0.02, input = 1, output = 2, currency = "¥" }, "deepseek-v4-pro" = { cache_hit = 0.025, input = 3, output = 6, currency = "¥" } } # per-model prices, per 1M tokens web_search = true # enable server-side web_search tool (Anthropic/DeepSeek API) ``` Example use, note that it doesn't try to perform the search via a call to a search engine: ``` ◆ reasonix · deepseek-v4-pro Context is kept across turns. Type 'exit' or Ctrl-D to quit. › search the web for hello ▎ thought for 1s • Hello Definition & Meaning | Britannica Dictionary https://www.britannica.com/dictionary/hello?srch_tag=e2cdp6pptoimak7ydbp6kjxddhwqysz3 • hello https://baike.baidu.com/item/hello/38467 • hello _ 百科 https://baike.sogou.com/v64731937.htm?addressbar=hide&jump_from=undefined&vrid=81001007 • hello https://baike.sogou.com/v64731937.htm?ch=frombaikevr&fromTitle=hello&vrid=30010097&entryScene=baike_VR_ruo&j ump_from=sogou-mobb-e447193f2b83d789&addressbar=hide#paragraph_3 • hello http://dict.youdao.com/w/hell_o/ • hello是什么意思 https://www.hanzidaquan.com/yingyu/hello.html • Hello! https://www.ldoceonline.com/dictionary/hello • hello是什么意思? https://wenwen.sogou.com/z/q961078741.htm • hello是什么意思,hello怎么读,hello的意思是:“喂”的招呼声或问候 https://fanyi.kkabc.com/ci/Hello • hello https://www.wordreference.com/enzh/hello Here are the top results from the web search for "hello": 1. Britannica Dictionary — Defines "hello" as a greeting, a telephone answer, a way to get attention, and an expression of surprise. Pronunciation: /həˈloʊ/. 2. Baidu Baike (百度百科) — Covers the history: derived from Old High German "halâ", popularized by Edison with the telephone. Notes its use in Chinese as "你好". 3. Sogou Baike (搜狗百科) — Similar to the Baidu entry, covering meanings, usage, and etymology including the Edison telephone story. 4. Youdao Dictionary — Lists: interjection (greeting, telephone, getting attention), noun (a greeting), and verb (to say hello). Also notes "Hello" as a song by Karmin. 5. Longman Dictionary — Comprehensive entry with usage examples: greeting, telephone, attracting attention, expressing surprise/confusion. Also covers informal alternatives (hi, hey, hiya). 6. WordReference — Bilingual English-Chinese entry with translations, compound forms ("golden hello", "say hello"), and pronunciation guides. If you had something more specific in mind, let me know and I can refine the search! ▎ thought for 0s · 33233 tok · in 32870 (12800 cached / 20070 new) · out 363 · ¥0.0627 ``` For esengine#4217 For esengine#5166
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds support for calling web_search via the provider.
Verification
Example provider config, using DeepSeek's support for the web_search tool:
Example use, note that it doesn't try to perform the search via a call to a search engine:
For #4217
For #5166
Cache impact
Cache-impact: none, deterministically adds a new tool definition, nothing else added to context
Cache-guard: new tool should not affect context.
System-prompt-review: N/A
For cache-sensitive changes, fill these lines before requesting review:
Cache-impact:none,low,medium, orhigh, plus the reason.Cache-guard: the focused guard test/command added or run, or why an existing guard covers the change.System-prompt-review: required reviewer/approval note when provider-visible system prompt, memory prefix, output style, or skill index behavior changes.