feat: add ShengSuanYun(胜算云) as a models provider.
This commit is contained in:
@@ -143,6 +143,7 @@ type ProvidersConfig struct {
|
|||||||
Gemini ProviderConfig `json:"gemini"`
|
Gemini ProviderConfig `json:"gemini"`
|
||||||
Nvidia ProviderConfig `json:"nvidia"`
|
Nvidia ProviderConfig `json:"nvidia"`
|
||||||
Moonshot ProviderConfig `json:"moonshot"`
|
Moonshot ProviderConfig `json:"moonshot"`
|
||||||
|
ShengSuanYun ProviderConfig `json:"shengsuanyun"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type ProviderConfig struct {
|
type ProviderConfig struct {
|
||||||
@@ -242,6 +243,7 @@ func DefaultConfig() *Config {
|
|||||||
Gemini: ProviderConfig{},
|
Gemini: ProviderConfig{},
|
||||||
Nvidia: ProviderConfig{},
|
Nvidia: ProviderConfig{},
|
||||||
Moonshot: ProviderConfig{},
|
Moonshot: ProviderConfig{},
|
||||||
|
ShengSuanYun: ProviderConfig{},
|
||||||
},
|
},
|
||||||
Gateway: GatewayConfig{
|
Gateway: GatewayConfig{
|
||||||
Host: "0.0.0.0",
|
Host: "0.0.0.0",
|
||||||
@@ -327,6 +329,9 @@ func (c *Config) GetAPIKey() string {
|
|||||||
if c.Providers.VLLM.APIKey != "" {
|
if c.Providers.VLLM.APIKey != "" {
|
||||||
return c.Providers.VLLM.APIKey
|
return c.Providers.VLLM.APIKey
|
||||||
}
|
}
|
||||||
|
if c.Providers.ShengSuanYun.APIKey != "" {
|
||||||
|
return c.Providers.ShengSuanYun.APIKey
|
||||||
|
}
|
||||||
return ""
|
return ""
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -289,6 +289,14 @@ func CreateProvider(cfg *config.Config) (LLMProvider, error) {
|
|||||||
apiKey = cfg.Providers.VLLM.APIKey
|
apiKey = cfg.Providers.VLLM.APIKey
|
||||||
apiBase = cfg.Providers.VLLM.APIBase
|
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":
|
case "claude-cli", "claudecode", "claude-code":
|
||||||
workspace := cfg.Agents.Defaults.Workspace
|
workspace := cfg.Agents.Defaults.Workspace
|
||||||
if workspace == "" {
|
if workspace == "" {
|
||||||
|
|||||||
Reference in New Issue
Block a user