We’re looking for feedbacks to improve this feature, share yours here.
The Summarization model generates a summary of your transcript.
You choose one of our summary type to customize the summarization based on your preference.
3 summarization types are available:
general : A regular summary of the transcription
concise : A shorter summary for quick overview
bullet_points : Retrieve the key points in a list
If no summarization_config is provided, general type will be used by default.
Find all this information in the API Reference (see summarization_config).
In the following examples, we’re using concise type.
asyncfunctionmakeFetchRequest(url:string, options:any){const response =awaitfetch(url, options);return response.json();}asyncfunctionpollForResult(resultUrl:string, headers:any){while(true){console.log("Polling for results...");const pollResponse =awaitmakeFetchRequest(resultUrl,{ headers });if(pollResponse.status ==="done"){console.log("- Transcription done: \n");const summarization = pollResponse.result.summarization;console.log(summarization);break;}else{console.log("Transcription status : ", pollResponse.status);awaitnewPromise((resolve)=>setTimeout(resolve,1000));}}}asyncfunctionstartTranscription(){const gladiaKey ="YOUR_GLADIA_API_TOKEN";const requestData ={
audio_url:"YOUR_AUDIO_URL",
summarization:true,
summarization_config:{
type:"concise"// can be 'general', 'concise' or 'bullet_points'// use 'general' if no summarization_config is provided}};const gladiaUrl ="https://api.gladia.io/v2/transcription/";const headers ={"x-gladia-key": gladiaKey,"Content-Type":"application/json",};console.log("- Sending initial request to Gladia API...");const initialResponse =awaitmakeFetchRequest(gladiaUrl,{
method:"POST",
headers,
body:JSON.stringify(requestData),});console.log("Initial response with Transcription ID :", initialResponse);if(initialResponse.result_url){awaitpollForResult(initialResponse.result_url, headers);}}startTranscription();