Move AI env var from main to scribe package

This commit is contained in:
Théo Poizat
2025-12-08 14:56:33 +01:00
committed by Dat H. Pham
parent f19993bb30
commit 26593b50ef
3 changed files with 13 additions and 8 deletions
-6
View File
@@ -77,10 +77,4 @@ class AppConfig {
static bool get isCozyIntegrationEnabled => dotenv.get('COZY_INTEGRATION', fallback: 'false') == 'true';
static String get cozyExternalBridgeVersion => dotenv.get('COZY_EXTERNAL_BRIDGE_VERSION', fallback: '0.16.1');
static bool get isAiEnabled => dotenv.get('AI_ENABLED', fallback: 'false') == 'true';
static String get aiApiKey => dotenv.get('AI_API_KEY', fallback: '');
static String get aiApiUrl => dotenv.get('AI_API_URL', fallback: '');
}
@@ -0,0 +1,11 @@
import 'package:flutter_dotenv/flutter_dotenv.dart';
class AIConfig {
const AIConfig._();
static bool get isAiEnabled => dotenv.get('AI_ENABLED', fallback: 'false') == 'true';
static String get aiApiKey => dotenv.get('AI_API_KEY', fallback: '');
static String get aiApiUrl => dotenv.get('AI_API_URL', fallback: '');
}
@@ -13,8 +13,8 @@ class AIDataSourceImpl implements AIDataSource {
required Dio dio,
}) : _aiApi = AIApi(
dio: dio,
apiKey: AppConfig.aiApiKey,
baseUrl: AppConfig.aiApiUrl,
apiKey: AIConfig.aiApiKey,
baseUrl: AIConfig.aiApiUrl,
);
@override