feat: switch voice chat from Anthropic to Groq (llama-3.3-70b) + proxy support
All checks were successful
Deploy / deploy (push) Successful in 1m26s

This commit is contained in:
Cosmo
2026-04-30 20:48:02 +00:00
parent 04b7d1f104
commit 4ba1aa43d5

View File

@@ -3,6 +3,7 @@ export const runtime = 'nodejs'
import { NextResponse } from 'next/server'
import Groq from 'groq-sdk'
import { HttpsProxyAgent } from 'https-proxy-agent'
import { voiceBus } from '@/lib/voice-bus'
import { systemPrompt } from '@/lib/voice-prompts'
@@ -45,7 +46,9 @@ function client(): Groq {
if (_client) return _client
const apiKey = process.env.GROQ_API_KEY
if (!apiKey) throw new Error('GROQ_API_KEY not set')
_client = new Groq({ apiKey })
const proxyUrl = process.env.GROQ_PROXY
const httpAgent = proxyUrl ? new HttpsProxyAgent(proxyUrl) : undefined
_client = new Groq({ apiKey, httpAgent } as any)
return _client
}