From 4ba1aa43d5da962b6e6d4c36b0150aeb026f734b Mon Sep 17 00:00:00 2001 From: Cosmo Date: Thu, 30 Apr 2026 20:48:02 +0000 Subject: [PATCH] feat: switch voice chat from Anthropic to Groq (llama-3.3-70b) + proxy support --- app/api/voice/chat/route.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/api/voice/chat/route.ts b/app/api/voice/chat/route.ts index 51bf127..cea0839 100644 --- a/app/api/voice/chat/route.ts +++ b/app/api/voice/chat/route.ts @@ -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 }