feat: implement database and AI provider configuration settings with Google GenAI integration

This commit is contained in:
Michael committed 2026-04-10 15:00:47 +02:00
1 parent 7372885e48
commit d0ca0c3602
7 files changed
+639 -108

No files matched your search

+12 -2
View File
@@ -11,6 +11,9 @@ export interface DbConfig {
url: string;
openRouterKey?: string;
openRouterModel?: string;
aiProvider?: "openrouter" | "google";
googleAiKey?: string;
googleAiModel?: string;
}
export async function testDatabaseConnection(url: string) {
@@ -34,9 +37,16 @@ export async function testDatabaseConnection(url: string) {
}
}
export async function saveDatabaseSettings(url: string, openRouterKey?: string, openRouterModel?: string) {
export async function saveDatabaseSettings(
url: string,
openRouterKey?: string,
openRouterModel?: string,
aiProvider?: "openrouter" | "google",
googleAiKey?: string,
googleAiModel?: string,
) {
try {
const config: DbConfig = { url, openRouterKey, openRouterModel };
const config: DbConfig = { url, openRouterKey, openRouterModel, aiProvider, googleAiKey, googleAiModel };
// S'assurer que le dossier data existe
await fs.mkdir(DATA_DIR, { recursive: true });