返回 DeepSeek-Reasonix
WEB_SEARCH.md
根目录 / docs / WEB_SEARCH.md
1 # Independent web search
2
3 Reasonix exposes `web_search` as an ordinary function tool. A search opens a
4 separate model request containing the query and the backend's native search
5 tool. The main conversation receives a bounded JSON result with `summary`,
6 `sources` (title and URL), and an optional `truncated` flag. Search reasoning,
7 encrypted source bodies and Responses replay items stay out of chat history.
8 The main model can use Chat Completions while search uses Messages or Responses.
9
10 ## Account selection
11
12 Search uses the current chat account when its search switch is enabled and the
13 account is configured. Otherwise it uses the first configured, enabled search
14 account in configuration order. An explicit `web_search = false` on a current
15 search-capable account prevents fallback. The selected search account and model
16 are frozen for that runtime assembly; a rebuild resolves them again.
17
18 Official DeepSeek accounts default to enabled when `web_search` is omitted.
19 Exact official Messages, Responses and Chat Completions routes (the latter
20 optionally ending in `/v1`) use the same account and model on
21 `https://api.deepseek.com/anthropic` for structured native search sources.
22 The main conversation keeps its protocol. Request URL overrides are not
23 translated. Third-party Messages and Responses accounts must opt in with
24 `web_search = true`; their configured endpoint and credentials remain unchanged.
25 Reasonix never sends a relay's key to the official DeepSeek endpoint.
26
27 The existing Desktop search switch applies to independent search too. No new
28 configuration fields or session migration are required. If `[tools].enabled`
29 is an explicit allowlist, include `web_search`. Offline mode omits this tool.
30 Providers supplied exclusively by a remote broker or extension do not imply
31 local search credentials: an enabled local search account is still needed.
32
33 ## Assigning a search model
34
35 Desktop **Model preferences → Model assignment → Web search** offers Automatic
36 or an explicit connection/model. Automatic preserves the account selection rules
37 above. An explicit assignment uses the search switch on the assigned connection,
38 independently of the conversation account's search switch.
39
40 ```toml
41 [agent]
42 web_search_model = "my-search-connection/deepseek-v4-flash"
43 ```
44
45 Omission, an empty string, and `"auto"` mean automatic selection. Explicit values
46 use `provider/model`, including model IDs containing `/`. Offline mode, the tool
47 allowlist and connection access restrictions still apply. Third-party candidates
48 indicate configured native-search eligibility, not live-verified model support.
49
50 Desktop writes the global user setting and displays an effective project override
51 when `reasonix.toml` owns the field. Selection is frozen when a runtime is built.
52 Saving in an idle session rebuilds its runtime; a running task cannot be forcibly
53 rebuilt by this setting. Other runtimes adopt it on their next rebuild.
54
55 If an assigned connection is removed, disabled or loses credentials, the reference
56 is retained. New runtimes omit the search tool and report the problem once; normal
57 chat remains available. There is no fallback to another account. Select Automatic
58 or a valid model to recover. Search requests and usage belong to the assigned
59 connection/model, without changing the conversation model.
60
61 No config-version or session migration is required. Previous versions ignore the
62 new field and retain their old search-selection behavior. Their general config
63 writer re-renders the file and may discard this field, comments and unknown keys;
64 downgrading does not preserve explicit search-account selection. Saving this
65 setting in the new Desktop changes only the field and preserves other content.
66
67 Switching between valid search assignments preserves the main model's tool
68 schema. Enabling or disabling the tool changes the tool list and may invalidate
69 an existing prompt-cache prefix.
70
71 ## Requests and results
72
73 Each call contains only its query, so include necessary context in the query.
74 The service cannot read the conversation, attachments, workspace or other
75 searches. Concurrent calls use independent provider clients. No client tools
76 are made available to the search model. Search fails if the provider returns
77 only prose without a completed native search result.
78
79 Calls have a 90-second deadline and an 8192-output-token budget. Results retain
80 up to eight distinct HTTP(S) sources and a bounded summary; the encoded result
81 is at most 24000 bytes so normal tool-output limits do not cut its JSON. Read
82 source pages with `web_fetch` when the summary is insufficient. Retrieved text
83 is untrusted content, not instructions. Search requests reject redirects.
84
85 Search token usage and HTTP attempt counts are reported separately as
86 `web-search` and included in task usage with the selected account's pricing.
87 Each search adds an auxiliary model request; cost and latency depend on that
88 model and endpoint. Search failures return through the normal tool-error path.
89 A third-party backend may complete search without exposing structured sources;
90 in that case `sources` is empty. Sources are never guessed from generated prose.
91
92 ## Compatibility and cache impact
93
94 Existing provider search switches and their explicit off values are preserved.
95 Old `server_search` records and native Responses items remain readable and
96 replayable. New results are ordinary tool messages, readable by older versions;
97 older source-card renderers may display their JSON as text. Current CLI and
98 Desktop accept both structured results and legacy title/URL output.
99
100 Replacing a native tool declaration with the function schema changes the
101 provider-visible tools and can invalidate an existing cache prefix. Within an
102 unchanged runtime, the tool schema/order remains fixed; queries and search
103 results append through ordinary tool turns. Search does not rewrite system
104 prompts, old messages or main-model thinking settings. Reduced total cost or a
105 higher cache hit rate is not guaranteed.
106
107 Independent search does not fix missing reasoning in the main model's other
108 tool calls. Those calls still follow their provider's reasoning replay policy.
109
110 ## Default-provider upgrade
111
112 New CLI defaults (`deepseek-flash`, `deepseek-pro`) and the Desktop `deepseek`
113 template use Chat Completions, with Flash selected, thinking enabled, high effort
114 and independent search enabled. Config version 9 migrates existing official
115 DeepSeek standard endpoints to Chat Completions, including renamed accounts,
116 Anthropic/Responses presets and standard request URL overrides, which are
117 cleared so the derived endpoint and its independent search still apply. Model
118 selection, key references, headers, extra body, effort, prices and search
119 settings survive.
120 Third-party gateways, nonstandard paths and URLs containing queries are excluded.
121 Later manual protocol edits remain authoritative. Project configs and session
122 files are not rewritten. Version 7 and 8 files receive a scalar-only edit preserving comments and unknown data;
123 earlier versions first run the existing config upgrades. Previous releases can
124 read the OpenAI route but lack independent search. An older binary with the old
125 startup migration may change minimal legacy provider entries again.
126
127 | Field / format | New reader of old data | Previous reader of new data | Conclusion |
128 | --- | --- | --- | --- |
129 | `kind` / `base_url` / request URLs | Official standard endpoints are migrated | Existing OpenAI values remain readable | No new protocol enum |
130 | `config_version` | One-time v9 upgrade; future versions remain untouched | Number remains readable; old automatic migrations have the limit above | Avoid mixing binaries with the retired migration |
131 | Models, pricing, effort, search switch | Preserved by this protocol migration | Unchanged field formats | User settings retained |
132 | Sessions | Unchanged files; existing adapter history projection | Unchanged file format | No session migration |
133
134 The exact beta ID `DeepSeek-V4.1-Flash-Expires-On-0910` has an explicit
135 Chat Completions wire alias `deepseek-v4.1-flash-expires-on-0910` on the official
136 host. Stored IDs and override ownership remain unchanged; arbitrary IDs are not
137 lowercased. This alias does not grant beta access or extend its availability.
138 Protocol changes can affect prefix-cache reuse on the first subsequent request.
139
139 lines MARKDOWN