From 426695e41035edcd0c25260fbae5753cf80d8481 Mon Sep 17 00:00:00 2001 From: lkddi Date: Thu, 2 Apr 2026 10:27:59 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D(BaccaratAI)=EF=BC=9A?= =?UTF-8?q?=E4=BC=98=E5=8C=96Prompt=E8=84=B1=E6=95=8F=E8=A7=84=E9=81=BF?= =?UTF-8?q?=E5=A4=A7=E6=A8=A1=E5=9E=8B=E9=81=93=E5=BE=B7=E5=AE=A1=E6=9F=A5?= =?UTF-8?q?=EF=BC=8C=E5=B9=B6=E6=96=B0=E5=A2=9E=E6=AD=A3=E5=88=99=E9=99=8D?= =?UTF-8?q?=E7=BA=A7=E5=8C=B9=E9=85=8D=E4=BB=A5=E5=85=BC=E5=AE=B9=E6=9C=AA?= =?UTF-8?q?=E8=BE=93=E5=87=BAJSON=E7=9A=84=E6=83=85=E5=86=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Services/BaccaratPredictionService.php | 41 ++++++++++++++++------ 1 file changed, 30 insertions(+), 11 deletions(-) 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}"); }