feat: GPT-4.1 optimierte Ergänzungssuche bei Maps-Lücke

Wenn Google Maps weniger Leads findet als angefragt, wird automatisch
eine optimierte Suchanfrage via GPT-4.1 generiert und als SERP-Job
gestartet, um die Lücke zu füllen. Die KI-Query wird im LoadingCard
angezeigt. Fallback auf Original-Query wenn kein OpenAI-Key konfiguriert.

- lib/services/openai.ts: GPT-4.1 Query-Generator
- app/api/search/supplement: neuer Endpoint (GPT + SERP-Job)
- LoadingCard: ruft /api/search/supplement statt direkt SERP
- apiKey.ts + .env.local.example: openai Key-Support

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
TimoUttenweiler
2026-04-01 10:43:33 +02:00
parent aa6707b8bc
commit 89a176700d
7 changed files with 156 additions and 20 deletions

View File

@@ -6,6 +6,7 @@ const ENV_VARS: Record<string, string> = {
apify: "APIFY_API_KEY",
vayne: "VAYNE_API_KEY",
googlemaps: "GOOGLE_MAPS_API_KEY",
openai: "OPENAI_API_KEY",
};
export async function getApiKey(service: string): Promise<string | null> {