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