Providers whose Responses API performs web_search server-side (DeepSeek
V4, #846) declare the tool as {"type": "web_search"} instead of a
function schema, run the search mid-generation, and return web_search_call
output items with url_citation annotations.
- convert_tools(): map the web_search function tool to the native schema
when the provider spec sets native_web_search
- parsing: synthesize a server_executed-marked web_search ToolCallRequest
from web_search_call items and url_citation annotations across all three
consumers (SSE, SDK stream, non-streaming), with tail-merge for
annotations that stream after the search item completes
- convert_messages(): replay server-executed calls as web_search_call
items and skip their function_call_output pairing
- assistant_message_with_tool_calls(): keep provider_specific_fields so
the server_executed marker survives into the conversation history
- tool_dispatch: short-circuit server-executed calls with a stub result
carrying the citations as sources — the local web_search tool never
re-runs a search the provider already performed