. */ declare(strict_types=1); namespace App\Services\AI; use App\Settings\AISettings\LMStudioSettings; use App\Settings\AISettings\OpenRouterSettings; enum AIPlatforms: string { case OPENROUTER = 'openrouter'; case LMSTUDIO = 'lmstudio'; /** * Returns the name attribute of the service tag for this platform, which is used to register the platform in the AIPlatformRegistry * @return string */ public function toServiceTagName(): string { return $this->value; } /** * Returns the class name of the settings class for this platform, which implements AIPlatformSettingsInterface * @return string * @phpstan-return class-string */ public function toSettingsClass(): string { return match ($this) { self::LMSTUDIO => LMStudioSettings::class, self::OPENROUTER => OpenRouterSettings::class, default => throw new \InvalidArgumentException(sprintf('No settings class defined for AI platform "%s".', $this->name)), }; } }