19 lines
809 B
JavaScript
19 lines
809 B
JavaScript
require('dotenv').config();
|
|
fetch('https://api.sarvam.ai/v1/chat/completions', {
|
|
method: 'POST',
|
|
headers: {
|
|
'Content-Type': 'application/json',
|
|
'api-subscription-key': process.env.SARVAM_API_KEY
|
|
},
|
|
body: JSON.stringify({
|
|
model: 'sarvam-105b',
|
|
temperature: 0.1,
|
|
messages: [
|
|
{role: 'system', content: 'You are an expert medical conversation diarizer for Indian languages. Output ONLY a valid JSON array. Format: [{"speaker":"doctor", "text":"..."}]'},
|
|
{role: 'user', content: 'आपण हे डिसिक्शन एक्सेलरी हे केले... चालेल तुम्हाला आयटी टीमचं? चालेल.'}
|
|
]
|
|
})
|
|
}).then(r => r.json()).then(d => {
|
|
console.log(JSON.stringify(d, null, 2));
|
|
}).catch(console.error);
|