feat: add AI Settings modal to manage API keys from the UI

This commit is contained in:
Christian Vidal Wolf
2026-04-24 13:45:38 +02:00
parent 43f94b3902
commit 13890af125
3 changed files with 146 additions and 2 deletions
+4 -1
View File
@@ -1,5 +1,8 @@
export async function generateDescription(prompt: string, systemPrompt: string): Promise<string> {
const apiKey = import.meta.env.VITE_ANTHROPIC_API_KEY || localStorage.getItem('ANTHROPIC_API_KEY') || '';
const apiKey =
localStorage.getItem('ANTHROPIC_API_KEY') ||
import.meta.env.VITE_ANTHROPIC_API_KEY ||
'';
if (!apiKey) {
throw new Error('Anthropic API Key not found. Please set VITE_ANTHROPIC_API_KEY in .env or ANTHROPIC_API_KEY in localStorage.');
}