. */ declare(strict_types=1); namespace App\Services\AI; use App\Settings\AISettings\LMStudioSettings; use App\Settings\AISettings\OpenRouterSettings; use Symfony\Contracts\Translation\TranslatableInterface; use Symfony\Contracts\Translation\TranslatorInterface; enum AIPlatforms: string implements TranslatableInterface { 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, }; } public function trans(TranslatorInterface $translator, ?string $locale = null): string { $key = 'settings.ai.' . $this->value; return $translator->trans($key, locale: $locale); } }