Add premium My Case MVP

This commit is contained in:
2026-05-23 10:17:34 +02:00
parent e0aeefc73e
commit 83fc71414f
33 changed files with 1275 additions and 148 deletions
+25
View File
@@ -0,0 +1,25 @@
<?php
declare(strict_types=1);
require_once __DIR__ . '/FreeTier.php';
/**
* Tier-aware model routing for tools that expose the existing engine selector.
*
* Plus/trial users get the cost-controlled Azure mini path. Pro users get the
* full Azure path. CaveauAI sessions keep the engine requested by their UI.
*/
final class ToolModels
{
public static function engineForUser(int $userId, string $requestedEngine): string
{
$valid = ['azure_mini', 'azure_full', 'gpu', 'regex'];
$requestedEngine = in_array($requestedEngine, $valid, true) ? $requestedEngine : 'azure_mini';
if ($userId <= 0) {
return $requestedEngine;
}
return FreeTier::tier($userId) === 'pro' ? 'azure_full' : 'azure_mini';
}
}