Skip to content

feat: support for anthropic web_search - #6593

Open
seankhliao wants to merge 1 commit into
esengine:main-v2from
seankhliao:push-xvovvxovovxz
Open

feat: support for anthropic web_search#6593
seankhliao wants to merge 1 commit into
esengine:main-v2from
seankhliao:push-xvovvxovovxz

Conversation

@seankhliao

@seankhliao seankhliao commented Jul 16, 2026

Copy link
Copy Markdown

Summary

Adds support for calling web_search via the provider.

Verification

Example provider config, using DeepSeek's support for the web_search tool:

[[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 #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, or high, 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.

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
@github-actions github-actions Bot added the v2 Go rewrite (1.x) — main-v2 branch, active development label Jul 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

v2 Go rewrite (1.x) — main-v2 branch, active development

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant