mirror of
https://github.com/laoxong/nofx.git
synced 2026-06-04 09:58:22 +08:00
feat: add OI ranking data support and fix trader config update issues
- Add OI ranking data fetching and formatting for AI prompts - Fix trader update not saving strategy_id, ai_model_id, initial_balance - Fix AI API key not set for non-qwen/deepseek providers - Add strategy_id to trader config API response - Remove old trader from memory before reloading on update - Clean up unused useTraderActions.ts
This commit is contained in:
@@ -676,10 +676,14 @@ func (tm *TraderManager) addTraderFromStore(traderCfg *store.Trader, aiModelCfg
|
||||
}
|
||||
|
||||
// Set API keys based on AI model
|
||||
if aiModelCfg.Provider == "qwen" {
|
||||
switch aiModelCfg.Provider {
|
||||
case "qwen":
|
||||
traderConfig.QwenKey = aiModelCfg.APIKey
|
||||
} else if aiModelCfg.Provider == "deepseek" {
|
||||
case "deepseek":
|
||||
traderConfig.DeepSeekKey = aiModelCfg.APIKey
|
||||
default:
|
||||
// For other providers (grok, openai, claude, gemini, kimi, etc.), use CustomAPIKey
|
||||
traderConfig.CustomAPIKey = aiModelCfg.APIKey
|
||||
}
|
||||
|
||||
// Create trader instance
|
||||
|
||||
Reference in New Issue
Block a user