mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 13:50:49 +00:00
fix(web-search): support provider base url overrides
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
1d9157a39ad18841d666af90c58e0539d6427cbd2ad0c1ce29047a5a2131ba7e config-baseline.json
|
||||
6666a7f876a31658b3e2f2a6564619cfaf2b282104fd6d7799656389431eb996 config-baseline.json
|
||||
80e6e8dce647aef2d1310de55a81d27de52cca47fc24bd7ad81b80f43a72b84c config-baseline.core.json
|
||||
1cec599c3d27c258b9df3446baa547cb164e502afa9b30c052bba8737183f551 config-baseline.channel.json
|
||||
8346667910d2b3a3884efce8f96591adebc4f7ea99ce18337b80e4d70bf8e4d2 config-baseline.plugin.json
|
||||
1b2cb7fec6752245bc2a3da4a835f0bf9d31e6a468e777a5bdb91820398f44d0 config-baseline.plugin.json
|
||||
|
||||
@@ -144,6 +144,33 @@ Choose your preferred auth method and follow the setup steps.
|
||||
| Thinking/reasoning | Yes (Gemini 2.5+ / Gemini 3+) |
|
||||
| Gemma 4 models | Yes |
|
||||
|
||||
## Web search
|
||||
|
||||
The bundled `gemini` web-search provider uses Gemini Google Search grounding.
|
||||
Configure it under `plugins.entries.google.config.webSearch`:
|
||||
|
||||
```json5
|
||||
{
|
||||
plugins: {
|
||||
entries: {
|
||||
google: {
|
||||
config: {
|
||||
webSearch: {
|
||||
apiKey: "AIza...", // optional if GEMINI_API_KEY is set
|
||||
baseUrl: "https://generativelanguage.googleapis.com/v1beta",
|
||||
model: "gemini-2.5-flash",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
```
|
||||
|
||||
`webSearch.baseUrl` is optional and exists for operator proxies or compatible
|
||||
Gemini API endpoints. See [Gemini search](/tools/gemini-search) for the
|
||||
provider-specific tool behavior.
|
||||
|
||||
<Tip>
|
||||
Gemini 3 models use `thinkingLevel` rather than `thinkingBudget`. OpenClaw maps
|
||||
Gemini 3, Gemini 3.1, and `gemini-*-latest` alias reasoning controls to
|
||||
|
||||
@@ -37,6 +37,8 @@ OpenClaw uses the xAI Responses API as the bundled xAI transport. The same
|
||||
and remote `code_execution`.
|
||||
If you store an xAI key under `plugins.entries.xai.config.webSearch.apiKey`,
|
||||
the bundled xAI model provider reuses that key as a fallback too.
|
||||
Set `plugins.entries.xai.config.webSearch.baseUrl` to route Grok `web_search`
|
||||
and, by default, `x_search` through an operator xAI Responses proxy.
|
||||
`code_execution` tuning lives under `plugins.entries.xai.config.codeExecution`.
|
||||
</Note>
|
||||
|
||||
@@ -343,6 +345,7 @@ Legacy aliases still normalize to the canonical bundled ids:
|
||||
| ------------------ | ------- | ------------------ | ------------------------------------ |
|
||||
| `enabled` | boolean | — | Enable or disable x_search |
|
||||
| `model` | string | `grok-4-1-fast` | Model used for x_search requests |
|
||||
| `baseUrl` | string | — | xAI Responses base URL override |
|
||||
| `inlineCitations` | boolean | — | Include inline citations in results |
|
||||
| `maxTurns` | number | — | Maximum conversation turns |
|
||||
| `timeoutSeconds` | number | — | Request timeout in seconds |
|
||||
@@ -357,6 +360,7 @@ Legacy aliases still normalize to the canonical bundled ids:
|
||||
xSearch: {
|
||||
enabled: true,
|
||||
model: "grok-4-1-fast",
|
||||
baseUrl: "https://api.x.ai/v1",
|
||||
inlineCitations: true,
|
||||
},
|
||||
},
|
||||
@@ -429,6 +433,9 @@ Legacy aliases still normalize to the canonical bundled ids:
|
||||
- `web_search`, `x_search`, and `code_execution` are exposed as OpenClaw
|
||||
tools. OpenClaw enables the specific xAI built-in it needs inside each tool
|
||||
request instead of attaching all native tools to every chat turn.
|
||||
- Grok `web_search` reads `plugins.entries.xai.config.webSearch.baseUrl`.
|
||||
`x_search` reads `plugins.entries.xai.config.xSearch.baseUrl`, then
|
||||
falls back to the Grok web-search base URL.
|
||||
- `x_search` and `code_execution` are owned by the bundled xAI plugin rather
|
||||
than hardcoded into the core model runtime.
|
||||
- `code_execution` is remote xAI sandbox execution, not local
|
||||
|
||||
@@ -39,6 +39,7 @@ citations.
|
||||
config: {
|
||||
webSearch: {
|
||||
apiKey: "AIza...", // optional if GEMINI_API_KEY is set
|
||||
baseUrl: "https://generativelanguage.googleapis.com/v1beta", // optional proxy/base URL override
|
||||
model: "gemini-2.5-flash", // default
|
||||
},
|
||||
},
|
||||
@@ -89,6 +90,14 @@ The default model is `gemini-2.5-flash` (fast and cost-effective). Any Gemini
|
||||
model that supports grounding can be used via
|
||||
`plugins.entries.google.config.webSearch.model`.
|
||||
|
||||
## Base URL overrides
|
||||
|
||||
Set `plugins.entries.google.config.webSearch.baseUrl` when Gemini web search
|
||||
must route through an operator proxy or custom Gemini-compatible endpoint. A
|
||||
plain `https://generativelanguage.googleapis.com` value is normalized to
|
||||
`https://generativelanguage.googleapis.com/v1beta`; custom proxy paths are kept
|
||||
as provided after trimming trailing slashes.
|
||||
|
||||
## Related
|
||||
|
||||
- [Web Search overview](/tools/web) -- all providers and auto-detection
|
||||
|
||||
@@ -61,6 +61,7 @@ If you skip it, you can enable or change `x_search` later in config.
|
||||
config: {
|
||||
webSearch: {
|
||||
apiKey: "xai-...", // optional if XAI_API_KEY is set
|
||||
baseUrl: "https://api.x.ai/v1", // optional Responses API proxy/base URL override
|
||||
},
|
||||
},
|
||||
},
|
||||
@@ -97,6 +98,14 @@ Grok uses a provider-specific 60 second default timeout because xAI Responses
|
||||
web-grounded searches can run longer than the shared `web_search` default. Set
|
||||
`tools.web.search.timeoutSeconds` to override it.
|
||||
|
||||
## Base URL overrides
|
||||
|
||||
Set `plugins.entries.xai.config.webSearch.baseUrl` when Grok web search should
|
||||
route through an operator proxy or xAI-compatible Responses endpoint. OpenClaw
|
||||
posts to `<baseUrl>/responses` after trimming trailing slashes. `x_search`
|
||||
uses the same `webSearch.baseUrl` fallback unless
|
||||
`plugins.entries.xai.config.xSearch.baseUrl` is set.
|
||||
|
||||
## Related
|
||||
|
||||
- [Web Search overview](/tools/web) -- all providers and auto-detection
|
||||
|
||||
@@ -334,6 +334,7 @@ tool on the request that serves this tool call.
|
||||
xSearch: {
|
||||
enabled: true,
|
||||
model: "grok-4-1-fast-non-reasoning",
|
||||
baseUrl: "https://api.x.ai/v1", // optional, overrides webSearch.baseUrl
|
||||
inlineCitations: false,
|
||||
maxTurns: 2,
|
||||
timeoutSeconds: 30,
|
||||
@@ -341,6 +342,7 @@ tool on the request that serves this tool call.
|
||||
},
|
||||
webSearch: {
|
||||
apiKey: "xai-...", // optional if XAI_API_KEY is set
|
||||
baseUrl: "https://api.x.ai/v1", // optional shared xAI Responses base URL
|
||||
},
|
||||
},
|
||||
},
|
||||
@@ -349,6 +351,11 @@ tool on the request that serves this tool call.
|
||||
}
|
||||
```
|
||||
|
||||
`x_search` posts to `<baseUrl>/responses` when
|
||||
`plugins.entries.xai.config.xSearch.baseUrl` is set. If that field is omitted,
|
||||
it falls back to `plugins.entries.xai.config.webSearch.baseUrl`, then the
|
||||
legacy `tools.web.search.grok.baseUrl`, and finally the public xAI endpoint.
|
||||
|
||||
### x_search parameters
|
||||
|
||||
| Parameter | Description |
|
||||
|
||||
Reference in New Issue
Block a user