fix(providers): preserve nanobot tools with OpenRouter server tools (#5335)

* fix(providers): preserve functions with extra body tools

* docs(providers): clarify extra body tool merging
This commit is contained in:
chengyongru
2026-08-11 18:23:27 +08:00
committed by GitHub
parent 3778e7e628
commit 57d81bc1cd
4 changed files with 78 additions and 8 deletions
+23
View File
@@ -100,6 +100,29 @@ Gateway-style setup for model IDs served through OpenRouter.
Use the model ID exactly as OpenRouter lists it.
To opt into OpenRouter server-managed search and fetch, add:
```json
{
"providers": {
"openrouter": {
"extraBody": {
"tools": [
{ "type": "openrouter:web_search" },
{ "type": "openrouter:web_fetch" }
]
}
}
}
}
```
Chat Completions-compatible OpenRouter
[server tools](https://openrouter.ai/docs/guides/features/server-tools), such as those above, are
appended to nanobot's generated functions. This keeps unrelated local tools such as `write_file`
available in the same request. Responses-only server tools require an API surface that the
OpenRouter provider does not currently enable.
### Eden AI Gateway
Eden AI exposes an OpenAI-compatible chat-completions endpoint at