fix: save raw AI response for debugging and require calculated numbers

- Add RawResponse field to FullDecision and DecisionRecord
- Save raw AI response to database for debugging parse failures
- Add IMPORTANT note in prompt: all numeric values must be calculated numbers, not formulas
This commit is contained in:
tinkle-community
2025-12-08 11:29:31 +08:00
parent 10047577e1
commit f39fc8af23
4 changed files with 16 additions and 8 deletions

View File

@@ -402,6 +402,7 @@ func (at *AutoTrader) runCycle() error {
record.SystemPrompt = aiDecision.SystemPrompt // Save system prompt
record.InputPrompt = aiDecision.UserPrompt
record.CoTTrace = aiDecision.CoTTrace
record.RawResponse = aiDecision.RawResponse // Save raw AI response for debugging
if len(aiDecision.Decisions) > 0 {
decisionJSON, _ := json.MarshalIndent(aiDecision.Decisions, "", " ")
record.DecisionJSON = string(decisionJSON)