. */ declare(strict_types=1); namespace App\Settings\AISettings; use App\Form\Type\APIKeyType; use App\Services\AI\AIPlatformSettingsInterface; use App\Settings\SettingsIcon; use Jbtronics\SettingsBundle\Metadata\EnvVarMode; use Jbtronics\SettingsBundle\Settings\Settings; use Jbtronics\SettingsBundle\Settings\SettingsParameter; use Jbtronics\SettingsBundle\Settings\SettingsTrait; use Symfony\Component\Translation\TranslatableMessage as TM; #[Settings(name: 'ai_openrouter', label: new TM("settings.ai.openrouter"), description: "settings.ai.openrouter.help")] #[SettingsIcon("fa-brain")] class OpenRouterSettings implements AIPlatformSettingsInterface { use SettingsTrait; #[SettingsParameter(label: new TM("settings.ips.element14.apiKey"), formType: APIKeyType::class, formOptions: ["help_html" => true], envVar: "AI_OPENROUTER_KEY", envVarMode: EnvVarMode::OVERWRITE)] public ?string $apiKey = null; public function isAIPlatformEnabled(): bool { return $this->apiKey !== null && $this->apiKey !== ""; } }