mirror of
https://github.com/NoFxAiOS/nofx.git
synced 2026-06-06 05:51:19 +08:00
feat: change claw402 default model from deepseek to glm-5
This commit is contained in:
@@ -218,7 +218,7 @@ func (s *Server) handleGetSupportedModels(c *gin.Context) {
|
|||||||
{"id": "grok", "name": "Grok (xAI)", "provider": "grok", "defaultModel": "grok-3-latest"},
|
{"id": "grok", "name": "Grok (xAI)", "provider": "grok", "defaultModel": "grok-3-latest"},
|
||||||
{"id": "kimi", "name": "Kimi (Moonshot)", "provider": "kimi", "defaultModel": "moonshot-v1-auto"},
|
{"id": "kimi", "name": "Kimi (Moonshot)", "provider": "kimi", "defaultModel": "moonshot-v1-auto"},
|
||||||
{"id": "minimax", "name": "MiniMax", "provider": "minimax", "defaultModel": "MiniMax-M2.7"},
|
{"id": "minimax", "name": "MiniMax", "provider": "minimax", "defaultModel": "MiniMax-M2.7"},
|
||||||
{"id": "claw402", "name": "Claw402 (Base USDC)", "provider": "claw402", "defaultModel": "deepseek"},
|
{"id": "claw402", "name": "Claw402 (Base USDC)", "provider": "claw402", "defaultModel": "glm-5"},
|
||||||
}
|
}
|
||||||
|
|
||||||
c.JSON(http.StatusOK, supportedModels)
|
c.JSON(http.StatusOK, supportedModels)
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ func (s *Server) handleBeginnerOnboarding(c *gin.Context) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if !reusedExisting {
|
if !reusedExisting {
|
||||||
if err := s.store.AIModel().Update(userID, "claw402", true, privateKey, "", "deepseek"); err != nil {
|
if err := s.store.AIModel().Update(userID, "claw402", true, privateKey, "", "glm-5"); err != nil {
|
||||||
logger.Errorf("Failed to save beginner claw402 config for user %s: %v", userID, err)
|
logger.Errorf("Failed to save beginner claw402 config for user %s: %v", userID, err)
|
||||||
c.JSON(http.StatusInternalServerError, gin.H{"error": "failed to save beginner model configuration"})
|
c.JSON(http.StatusInternalServerError, gin.H{"error": "failed to save beginner model configuration"})
|
||||||
return
|
return
|
||||||
@@ -68,7 +68,7 @@ func (s *Server) handleBeginnerOnboarding(c *gin.Context) {
|
|||||||
|
|
||||||
os.Setenv("CLAW402_WALLET_KEY", privateKey)
|
os.Setenv("CLAW402_WALLET_KEY", privateKey)
|
||||||
os.Setenv("CLAW402_WALLET_ADDRESS", address)
|
os.Setenv("CLAW402_WALLET_ADDRESS", address)
|
||||||
os.Setenv("CLAW402_DEFAULT_MODEL", "deepseek")
|
os.Setenv("CLAW402_DEFAULT_MODEL", "glm-5")
|
||||||
|
|
||||||
envSaved, envPath, envErr := persistBeginnerWalletEnv(privateKey, address)
|
envSaved, envPath, envErr := persistBeginnerWalletEnv(privateKey, address)
|
||||||
resp := beginnerOnboardingResponse{
|
resp := beginnerOnboardingResponse{
|
||||||
@@ -77,7 +77,7 @@ func (s *Server) handleBeginnerOnboarding(c *gin.Context) {
|
|||||||
Chain: "base",
|
Chain: "base",
|
||||||
Asset: "USDC",
|
Asset: "USDC",
|
||||||
Provider: "claw402",
|
Provider: "claw402",
|
||||||
DefaultModel: "deepseek",
|
DefaultModel: "glm-5",
|
||||||
ConfiguredModelID: configuredModelID,
|
ConfiguredModelID: configuredModelID,
|
||||||
BalanceUSDC: wallet.QueryUSDCBalanceStr(address),
|
BalanceUSDC: wallet.QueryUSDCBalanceStr(address),
|
||||||
EnvSaved: envSaved,
|
EnvSaved: envSaved,
|
||||||
@@ -233,7 +233,7 @@ func persistBeginnerWalletEnv(privateKey string, address string) (bool, string,
|
|||||||
if err := upsertEnvFile(path, map[string]string{
|
if err := upsertEnvFile(path, map[string]string{
|
||||||
"CLAW402_WALLET_KEY": privateKey,
|
"CLAW402_WALLET_KEY": privateKey,
|
||||||
"CLAW402_WALLET_ADDRESS": address,
|
"CLAW402_WALLET_ADDRESS": address,
|
||||||
"CLAW402_DEFAULT_MODEL": "deepseek",
|
"CLAW402_DEFAULT_MODEL": "glm-5",
|
||||||
}); err != nil {
|
}); err != nil {
|
||||||
lastErr = err
|
lastErr = err
|
||||||
continue
|
continue
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ import (
|
|||||||
|
|
||||||
const (
|
const (
|
||||||
DefaultClaw402URL = "https://claw402.ai"
|
DefaultClaw402URL = "https://claw402.ai"
|
||||||
DefaultClaw402Model = "deepseek"
|
DefaultClaw402Model = "glm-5"
|
||||||
)
|
)
|
||||||
|
|
||||||
// claw402ModelEndpoints maps user-friendly model names to claw402 API paths.
|
// claw402ModelEndpoints maps user-friendly model names to claw402 API paths.
|
||||||
@@ -39,6 +39,9 @@ var claw402ModelEndpoints = map[string]string{
|
|||||||
"gemini-3.1-pro": "/api/v1/ai/gemini/chat/3.1-pro",
|
"gemini-3.1-pro": "/api/v1/ai/gemini/chat/3.1-pro",
|
||||||
// Kimi
|
// Kimi
|
||||||
"kimi-k2.5": "/api/v1/ai/kimi/chat/k2.5",
|
"kimi-k2.5": "/api/v1/ai/kimi/chat/k2.5",
|
||||||
|
// Z.AI (智谱)
|
||||||
|
"glm-5": "/api/v1/ai/zhipu/chat",
|
||||||
|
"glm-5-turbo": "/api/v1/ai/zhipu/chat/turbo",
|
||||||
}
|
}
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
|
|||||||
@@ -96,7 +96,7 @@ export const AI_PROVIDER_CONFIG: Record<string, AIProviderConfig> = {
|
|||||||
apiName: 'MiniMax',
|
apiName: 'MiniMax',
|
||||||
},
|
},
|
||||||
claw402: {
|
claw402: {
|
||||||
defaultModel: 'deepseek',
|
defaultModel: 'glm-5',
|
||||||
apiUrl: 'https://claw402.ai',
|
apiUrl: 'https://claw402.ai',
|
||||||
apiName: 'Claw402',
|
apiName: 'Claw402',
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user