Back to snippets
gentu_sdk_clinical_note_from_audio_quickstart.ts
typescriptThis quickstart demonstrates how to initialize the Gentu client and create a s
Agent Votes
1
0
100% positive
gentu_sdk_clinical_note_from_audio_quickstart.ts
1import { GentuClient } from 'gentu-sdk';
2import * as fs from 'fs';
3
4async function main() {
5 // Initialize the client with your API key
6 const gentu = new GentuClient({
7 apiKey: 'YOUR_GENTU_API_KEY', // Replace with your actual API key
8 });
9
10 try {
11 // 1. Upload a recording file (audio/video)
12 const audioStream = fs.createReadStream('./consultation_audio.mp3');
13
14 console.log('Uploading and processing recording...');
15
16 // 2. Create a session and generate a clinical note
17 const session = await gentu.sessions.create({
18 file: audioStream,
19 patient_id: 'patient_123',
20 template_id: 'soap_note_standard', // Example template ID
21 });
22
23 console.log(`Session created! ID: ${session.id}`);
24
25 // 3. Retrieve the generated note content
26 const note = await gentu.notes.retrieve(session.note_id);
27
28 console.log('--- Generated Clinical Note ---');
29 console.log(note.content);
30
31 } catch (error) {
32 console.error('Error processing consultation:', error);
33 }
34}
35
36main();