mirror of
https://github.com/laoxong/nofx.git
synced 2026-06-06 18:58:22 +08:00
Merge pull request #88 from fanyinghao/fix-decision-result
fix: Correct error handling in GetFullDecision function
This commit is contained in:
+3
-3
@@ -115,7 +115,7 @@ func GetFullDecisionWithCustomPrompt(ctx *Context, mcpClient *mcp.Client, custom
|
||||
// 4. 解析AI响应
|
||||
decision, err := parseFullDecisionResponse(aiResponse, ctx.Account.TotalEquity, ctx.BTCETHLeverage, ctx.AltcoinLeverage)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("解析AI响应失败: %w", err)
|
||||
return decision, fmt.Errorf("解析AI响应失败: %w", err)
|
||||
}
|
||||
|
||||
decision.Timestamp = time.Now()
|
||||
@@ -397,7 +397,7 @@ func parseFullDecisionResponse(aiResponse string, accountEquity float64, btcEthL
|
||||
return &FullDecision{
|
||||
CoTTrace: cotTrace,
|
||||
Decisions: []Decision{},
|
||||
}, fmt.Errorf("提取决策失败: %w\n\n=== AI思维链分析 ===\n%s", err, cotTrace)
|
||||
}, fmt.Errorf("提取决策失败: %w", err)
|
||||
}
|
||||
|
||||
// 3. 验证决策
|
||||
@@ -405,7 +405,7 @@ func parseFullDecisionResponse(aiResponse string, accountEquity float64, btcEthL
|
||||
return &FullDecision{
|
||||
CoTTrace: cotTrace,
|
||||
Decisions: decisions,
|
||||
}, fmt.Errorf("决策验证失败: %w\n\n=== AI思维链分析 ===\n%s", err, cotTrace)
|
||||
}, fmt.Errorf("决策验证失败: %w", err)
|
||||
}
|
||||
|
||||
return &FullDecision{
|
||||
|
||||
Reference in New Issue
Block a user