diff --git a/app/Services/BaccaratPredictionService.php b/app/Services/BaccaratPredictionService.php index f4b5377..9161a79 100644 --- a/app/Services/BaccaratPredictionService.php +++ b/app/Services/BaccaratPredictionService.php @@ -128,40 +128,40 @@ class BaccaratPredictionService $historyText = ''; if (empty($history)) { - $historyText = '暂无下注历史记录。'; + $historyText = '暂无推测历史记录。'; } else { foreach ($history as $bet) { $betAction = $labelMap[$bet['bet_type']] ?? $bet['bet_type']; $profitText = $bet['profit'] > 0 ? "赢 +{$bet['profit']}" : "负 {$bet['profit']}"; - $historyText .= "- 第 {$bet['round_id']} 局:押 {$betAction} {$bet['amount']} 金币,结果:{$profitText}\n"; + $historyText .= "- 第 {$bet['round_id']} 局:投入 {$betAction} {$bet['amount']} 积分,结果:{$profitText}\n"; } } return << 'big', + '小' => 'small', + '豹子' => 'triple', + '观望', 'pass' => 'pass', + default => null, + }; + if ($fallbackAction) { + return [ + 'action' => $fallbackAction, + 'percentage' => $fallbackAction === 'pass' ? 0 : 5, + 'reason' => '(触发文本降级解析)'.mb_substr($reply, 0, 50), + ]; + } + } + throw new \Exception("AI 返回的 JSON 格式非法无法解析:{$reply}"); }