From 896eae4c5604615ed9189bbe0fff598cf4c25480 Mon Sep 17 00:00:00 2001 From: coohu <1257817341@qq.com> Date: Fri, 13 Feb 2026 15:55:59 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20add=20ShengSuanYun(=E8=83=9C=E7=AE=97?= =?UTF-8?q?=E4=BA=91)=20as=20a=20models=20provider.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pkg/config/config.go | 5 +++++ pkg/providers/http_provider.go | 8 ++++++++ 2 files changed, 13 insertions(+) diff --git a/pkg/config/config.go b/pkg/config/config.go index 56f1e19..bacf5c5 100644 --- a/pkg/config/config.go +++ b/pkg/config/config.go @@ -143,6 +143,7 @@ type ProvidersConfig struct { Gemini ProviderConfig `json:"gemini"` Nvidia ProviderConfig `json:"nvidia"` Moonshot ProviderConfig `json:"moonshot"` + ShengSuanYun ProviderConfig `json:"shengsuanyun"` } type ProviderConfig struct { @@ -242,6 +243,7 @@ func DefaultConfig() *Config { Gemini: ProviderConfig{}, Nvidia: ProviderConfig{}, Moonshot: ProviderConfig{}, + ShengSuanYun: ProviderConfig{}, }, Gateway: GatewayConfig{ Host: "0.0.0.0", @@ -327,6 +329,9 @@ func (c *Config) GetAPIKey() string { if c.Providers.VLLM.APIKey != "" { return c.Providers.VLLM.APIKey } + if c.Providers.ShengSuanYun.APIKey != "" { + return c.Providers.ShengSuanYun.APIKey + } return "" } diff --git a/pkg/providers/http_provider.go b/pkg/providers/http_provider.go index 7179c4c..b1d0c03 100644 --- a/pkg/providers/http_provider.go +++ b/pkg/providers/http_provider.go @@ -289,6 +289,14 @@ func CreateProvider(cfg *config.Config) (LLMProvider, error) { apiKey = cfg.Providers.VLLM.APIKey apiBase = cfg.Providers.VLLM.APIBase } + case "shengsuanyun": + if cfg.Providers.ShengSuanYun.APIKey != "" { + apiKey = cfg.Providers.ShengSuanYun.APIKey + apiBase = cfg.Providers.ShengSuanYun.APIBase + if apiBase == "" { + apiBase = "https://router.shengsuanyun.com/api/v1" + } + } case "claude-cli", "claudecode", "claude-code": workspace := cfg.Agents.Defaults.Workspace if workspace == "" {