Add OmniRoute web search toolkit (omniroute_web_search, omniroute_web_fetch, omniroute_search_providers)
This commit is contained in:
1 parent
45310dd2a4
commit
507561466e
6 files changed
+283
-9
No files matched your search
@@ -1,6 +1,6 @@
|
||||
# omniroute-plugin
|
||||
|
||||
OmniRoute gateway integration for the DeepSeek Harness (DSH): **model auto-import** (context window, max output, modalities, thinking levels) and **provider quota tracking** under the composer.
|
||||
OmniRoute gateway integration for the DeepSeek Harness (DSH): **model auto-import** (context window, max output, modalities, thinking levels) **provider quota tracking** under the composer, and a **web search toolkit** for the agent backed by OmniRoute's search/fetch providers.
|
||||
|
||||
## Features
|
||||
|
||||
@@ -9,13 +9,14 @@ OmniRoute gateway integration for the DeepSeek Harness (DSH): **model auto-impor
|
||||
- **Include / exclude filters**: comma-separated glob patterns (`*`, `?`) on model ids, e.g. `claude*, gemini-*`; exclude always wins.
|
||||
- **Manage imported models**: search, select and prune models from the provider.
|
||||
- **Quota tracking**: provider quotas (5-hour, weekly, monthly, …) shown in the composer dock, refreshed every `pollSec` seconds (default 120); requires a management-scoped API key.
|
||||
- **Web search toolkit for the agent** (see below): `omniroute_web_search`, `omniroute_web_fetch`, `omniroute_search_providers`, routed through the gateway's `/v1/search` and `/v1/web/fetch`.
|
||||
- English and Chinese UI.
|
||||
|
||||
## Files
|
||||
|
||||
| File | Role |
|
||||
| --- | --- |
|
||||
| `index.js` | Host plugin. Injects `webServer`, `connection`, `credentials`, `settings`. |
|
||||
| `index.js` | Host plugin. Injects `webServer`, `connection`, `credentials`, `settings`, `tools`. |
|
||||
| `client.js` | Web client: settings panel (`plugins.bundle.config`) and quota dock (`conversation.composer.dock`). |
|
||||
| `locale/*.json` | Plugin title/description (en, zh). |
|
||||
| `cordis.patch.yml` | Bundle patch inserting the `omniroute` row. |
|
||||
@@ -31,6 +32,26 @@ OmniRoute gateway integration for the DeepSeek Harness (DSH): **model auto-impor
|
||||
| `POST /omniroute/prune` | Remove selected imported models |
|
||||
| `POST /omniroute/import` | Import models/combos into the `llm-pi-ai` provider |
|
||||
| `GET /omniroute/quotas` | Provider quotas (`?model=<id>` narrows to that model's provider) |
|
||||
| `GET /omniroute/search-providers` | Web search / fetch providers known to the gateway |
|
||||
|
||||
## Web search toolkit
|
||||
|
||||
While **Web search tools** is on (default), the plugin registers three agent tools. They use the same gateway URL and API key as the rest of the plugin, so nothing extra needs configuring. To use them, enable at least one search provider in OmniRoute (Dashboard → Search).
|
||||
|
||||
| Tool | What it does |
|
||||
| --- | --- |
|
||||
| `omniroute_web_search` | `POST /v1/search`. Params: `query` (required), `max_results` (1–20), `search_type` (`web`/`news`/`x`), `time_range` (`any/hour/day/week/month/year`), `include_domains`, `exclude_domains`, `country`, `language`, `provider`. Returns `{provider, query, results:[{n,title,url,snippet,published?,content?}], answer?}`. |
|
||||
| `omniroute_web_fetch` | `POST /v1/web/fetch`. Params: `url` (required), `format` (`markdown`/`html`), `max_characters` (default 20000), `provider`. Returns the page content (truncated, with a `truncated` marker) and links. |
|
||||
| `omniroute_search_providers` | Lists the gateway's search/fetch providers with `kind`, `status` (`configured`/`missing`), supported search types and cost per query. |
|
||||
|
||||
**Choosing a provider:**
|
||||
1. The tool call's `provider` argument wins.
|
||||
2. Otherwise the **Search provider** / **Fetch provider** setting is used.
|
||||
3. If both are blank, the plugin picks the first provider OmniRoute reports as `configured`. The list is cached for 10 minutes and refreshed on save.
|
||||
|
||||
This matters because the gateway's built-in default (`duckduckgo-free`) often returns no results.
|
||||
|
||||
Every result is prefixed with a notice telling the model to treat web content as untrusted data. Turning the toggle off unregisters the tools immediately, with no restart. The tool names don't clash with DSH's built-in `web_search` / `web_fetch`, so both can be enabled at once.
|
||||
|
||||
## Installation
|
||||
|
||||
@@ -79,6 +100,7 @@ Re-run the `add` command from Option A (or `git pull` in your Option B checkout)
|
||||
- Use a management-scoped key if you want quota tracking.
|
||||
3. Press **Test**, then **Save**, then **Re-discover models**.
|
||||
4. Pick an `omni/…` model in the model selector. Quotas appear under the composer.
|
||||
5. *(Optional)* Under **Web search tools**, set a preferred search/fetch provider and the default number of results.
|
||||
|
||||
### Configuration file
|
||||
|
||||
@@ -96,7 +118,11 @@ Non-secret settings live in `<profile>/omniroute.json` (`$DSH_PROFILE_DIR` or `~
|
||||
"discoverThinking": true,
|
||||
"usage": true,
|
||||
"pollSec": 120,
|
||||
"syncMin": 60
|
||||
"syncMin": 60,
|
||||
"webSearch": true,
|
||||
"searchProvider": "",
|
||||
"fetchProvider": "",
|
||||
"searchMaxResults": 8
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
Reference in new issue
Block a user