feat(百家乐AI预测): 指定使用 glm-5.1-free 模型,回退默认

- BaccaratPredictionService 新增 PREFERRED_MODEL 常量(glm-5.1-free)
- predict() 优先通过 findByModel() 找到指定模型,找不到再用 getDefault()
- AiProviderConfig 新增 findByModel() 静态方法(按模型名称查找已启用配置)
- 经实测:dmxapi/glm-5.1-free 返回正常,耗时约 1.6~7s,格式完全正确
This commit is contained in:
2026-03-28 20:59:50 +08:00
parent 348f4e0fe0
commit c9a569fc42
2 changed files with 27 additions and 2 deletions
+14
View File
@@ -123,4 +123,18 @@ class AiProviderConfig extends Model
->orderBy('sort_order')
->get();
}
/**
* 按模型名称查找已启用的 AI 配置
*
* 用于特定业务场景(如百家乐预测)指定使用某款模型。
*
* @param string $model 模型名称(完整匹配)
*/
public static function findByModel(string $model): ?self
{
return static::where('is_enabled', true)
->where('model', $model)
->first();
}
}