Register ShengSuanYun as a standard provider

This commit is contained in:
Xubin Ren committed 2026-11-14 20:44:28 +08:00
1 parent 0b9e546672
commit 259c05e747
17 files changed
+265 -503

No files matched your search

+2 -1
View File
@@ -304,7 +304,8 @@ A Base URL is the service address nanobot sends model requests to. Change it onl
> - **Kimi Coding Plan**: Use `providers.kimiCoding` with `provider: "kimi_coding"` for Kimi's dedicated Anthropic Messages API endpoint. The endpoint requires a Claude-compatible `User-Agent`; nanobot sends `claude-code/0.1.0` by default, and you can override it with `extraHeaders.User-Agent` if your account requires a different value.
> - **VolcEngine / BytePlus Coding Plan**: Subscription endpoints are configured through dedicated providers `volcengineCodingPlan` or `byteplusCodingPlan`, separate from the pay-per-use `volcengine` / `byteplus` providers.
> - **OpenCode Zen / Go**: `providers.opencode` (canonical Zen), the legacy-compatible `providers.opencodeZen`, and `providers.opencodeGo` use the same `OPENCODE_API_KEY`, but route to different OpenCode gateways. These providers use OpenCode's OpenAI-compatible `chat/completions` endpoints; choose model IDs from that endpoint family.
> - **ShengSuanYun (胜算云)**: Search for **ShengSuanYun Router** in **Add provider**, or select it under **Quick Start** in `nanobot onboard --wizard`. Both prefill the [Router API URL](https://lean.shengsuanyun.com/apidocs/guides/quick-start) for a custom connection. Enter your API key and use the full model ID, for example `deepseek/deepseek-v4-flash`. The wizard saves a separate model preset and keeps any configured default model. Chat Completions is the default; select Responses in a preset's **Advanced options** only for a model that supports it.
> - **ShengSuanYun (胜算云)**: Select **ShengSuanYun Router** in **Settings → Models → Add provider** or in the Quick Start wizard (`nanobot onboard --wizard`). The built-in connection `providers.shengsuanyun` uses the [Router API URL](https://lean.shengsuanyun.com/apidocs/guides/quick-start). Use the full model ID, such as `deepseek/deepseek-v4-flash`. The default is Chat Completions; select Responses only for models that support it.
> If you previously used the exact key `shengsuanyun` for a hand-written custom connection, give it a different key and update matching provider references before upgrading. Custom connections created through the WebUI already have distinct keys and do not need changes.
> - **Zhipu Coding Plan**: If you're on Zhipu's coding plan, open the zhipu connection in **Settings → Models** and set its base URL to `https://open.bigmodel.cn/api/coding/paas/v4`.
> - **Alibaba Cloud BaiLian**: The built-in `dashscope` provider already defaults to `https://dashscope.aliyuncs.com/compatible-mode/v1`; no endpoint override is needed for that service.
> - **ModelScope**: The built-in `modelscope` provider already defaults to `https://api-inference.modelscope.cn/v1`; no endpoint override is needed for that service.
-4
View File
@@ -48,10 +48,6 @@ Useful `ProviderSpec` options:
| `responses` | `ResponsesCapabilities` with automatic model rules, reasoning replay, and fallback policy. |
| `is_transcription_only` | Provider has credentials but cannot serve chat completions. |
### Setup templates for compatible endpoints
If a provider only needs a prefilled URL and request API options, add an entry to `PROVIDER_SETUP_TEMPLATES` in [`nanobot/providers/setup.py`](../nanobot/providers/setup.py). Quick Start and WebUI read the same declaration. A template creates an ordinary custom connection; it does not reserve a runtime provider ID or add a new adapter.
### Request API routing
`resolve_provider_route` in `nanobot/providers/routing.py` validates connection and preset declarations and selects the adapter. Built-in OpenAI connection declarations set an overridable default; custom connection declarations also limit the preset's allowed APIs.