feat: switch voice chat from Anthropic to Groq (llama-3.3-70b) + proxy support
All checks were successful
Deploy / deploy (push) Successful in 1m26s
All checks were successful
Deploy / deploy (push) Successful in 1m26s
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user