Implement AI-powered chat interface with voice input capabilities. Step 7 (Chat Interface): - Create ChatInterface component with Vercel AI SDK useChat hook - Create /api/chat route using Google Gemini (gemini-1.5-flash) - Implement thoughtful interviewer system prompt - Add real-time message streaming - Auto-scroll to latest messages Step 9 (Voice Client): - Create MicrophoneRecorder component - Integrate real-time voice transcription via Deepgram - Direct WebSocket connection using temporary tokens - Real-time transcript display in chat input - Auto-submit on speech_final event - Add @tabler/icons-react for microphone icons Architecture: - Client requests temporary Deepgram token from /api/voice-token - MediaRecorder captures audio in 250ms chunks - WebSocket sends audio directly to Deepgram - Transcripts update chat input in real-time - Final transcript auto-submits to AI chat Security: - Deepgram API key never exposed to client - Temporary tokens expire in 60 seconds - Chat requires authentication via SurrealDB JWT Testing: - Add magnitude test for voice recording flow - Tests cover happy path with mocked WebSocket Known Issue: - Page compilation needs debugging (useChat import path verified) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
51 lines
1.3 KiB
JSON
51 lines
1.3 KiB
JSON
{
|
|
"name": "ponderants",
|
|
"version": "0.1.0",
|
|
"private": true,
|
|
"scripts": {
|
|
"dev": "next dev",
|
|
"build": "next build",
|
|
"start": "next start",
|
|
"lint": "next lint",
|
|
"test": "npx magnitude"
|
|
},
|
|
"dependencies": {
|
|
"@ai-sdk/google": "latest",
|
|
"@ai-sdk/react": "latest",
|
|
"@atproto/api": "latest",
|
|
"@deepgram/sdk": "latest",
|
|
"@google/generative-ai": "^0.24.1",
|
|
"@mantine/core": "latest",
|
|
"@mantine/form": "latest",
|
|
"@mantine/hooks": "latest",
|
|
"@react-three/drei": "latest",
|
|
"@react-three/fiber": "latest",
|
|
"@tabler/icons-react": "^3.35.0",
|
|
"ai": "latest",
|
|
"jsonwebtoken": "latest",
|
|
"next": "latest",
|
|
"openid-client": "latest",
|
|
"react": "latest",
|
|
"react-dom": "latest",
|
|
"surrealdb": "latest",
|
|
"three": "latest",
|
|
"umap-js": "latest",
|
|
"zod": "latest"
|
|
},
|
|
"devDependencies": {
|
|
"@types/jsonwebtoken": "latest",
|
|
"@types/node": "latest",
|
|
"@types/react": "latest",
|
|
"@types/react-dom": "latest",
|
|
"eslint": "latest",
|
|
"eslint-config-next": "latest",
|
|
"jiti": "^2.6.1",
|
|
"magnitude-test": "latest",
|
|
"playwright": "^1.56.1",
|
|
"postcss": "latest",
|
|
"postcss-preset-mantine": "latest",
|
|
"postcss-simple-vars": "latest",
|
|
"typescript": "latest"
|
|
}
|
|
}
|