/** * VoiceAI: Transcribes and extracts medical insights from doctor-patient conversations. * Uses AI to filter out small talk and focus on health details. */ class VoiceAI { async extractInsights(transcript) { // In a real app, this would be a prompt to Gemini: // "Extract only medical advice, diagnosis, and next steps from this transcript. Ignore small talk." const smallTalkKeywords = ['weather', 'family', 'how are you', 'cricket', 'politics']; // Simulation of AI filtering const lines = transcript.split('. '); const medicalLines = lines.filter(line => { const isSmallTalk = smallTalkKeywords.some(kw => line.toLowerCase().includes(kw)); return !isSmallTalk && line.length > 10; }); const summary = medicalLines.join('. ') + '.'; return { summary, whatsappMessage: `👨‍⚕️ *Doctor's Key Insights from Your Visit*\n\n${summary}\n\n_Stay healthy!_` }; } getMockTranscript() { return "Hello Rahul, how is your family? The weather is very hot today. Regarding your cough, it seems like a viral infection. You should avoid cold drinks for 3 days. Also, did you watch the match yesterday? Take the paracetamol after meals. I'll see you in a week."; } } module.exports = new VoiceAI();