feat: switch embeddings from Voyage AI to Google Gemini text-embedding-004

- embedText: call Gemini REST API (768-dim) instead of Voyage (1024-dim)
- Migration: drop+recreate incidents.embedding as vector(768), update
  match_incidents function, swap VOYAGE_API_KEY → GOOGLE_AI_API_KEY in app_settings
- Settings UI: relabel to "Google AI API Key (Embeddings)"
- All call sites updated (incidents POST, similar GET)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CPf5Rc8QPx6V8KLEEgfKEQ
This commit is contained in:
2026-07-13 06:50:35 +08:00
co-authored by Claude Sonnet 4.6
parent 614c792225
commit d10c690c12
7 changed files with 82 additions and 30 deletions
+2 -2
View File
@@ -10,13 +10,13 @@ interface Props {
const KEY_LABELS: Record<string, string> = {
DEEPSEEK_API_KEY: 'DeepSeek API Key (AI)',
VOYAGE_API_KEY: 'Voyage AI API Key (Embeddings)',
GOOGLE_AI_API_KEY: 'Google AI API Key (Embeddings)',
}
export function ApiKeyForm({ settings }: Props) {
const [values, setValues] = useState<Record<string, string>>({
DEEPSEEK_API_KEY: '',
VOYAGE_API_KEY: '',
GOOGLE_AI_API_KEY: '',
})
const [saving, setSaving] = useState<Record<string, boolean>>({})
const [results, setResults] = useState<Record<string, 'ok' | 'error'>>({})