@@ -41,13 +41,15 @@ export class Nova3Node extends ExecutableNode {
4141 {
4242 name : "detect_language" ,
4343 type : "boolean" ,
44- description : "Identifies the dominant language spoken in submitted audio" ,
44+ description :
45+ "Identifies the dominant language spoken in submitted audio" ,
4546 value : true ,
4647 } ,
4748 {
4849 name : "diarize" ,
4950 type : "boolean" ,
50- description : "Recognize speaker changes. Each word will be assigned a speaker number" ,
51+ description :
52+ "Recognize speaker changes. Each word will be assigned a speaker number" ,
5153 value : false ,
5254 } ,
5355 {
@@ -71,7 +73,8 @@ export class Nova3Node extends ExecutableNode {
7173 {
7274 name : "smart_format" ,
7375 type : "boolean" ,
74- description : "Apply formatting to transcript output for improved readability" ,
76+ description :
77+ "Apply formatting to transcript output for improved readability" ,
7578 value : true ,
7679 } ,
7780 {
@@ -83,7 +86,8 @@ export class Nova3Node extends ExecutableNode {
8386 {
8487 name : "paragraphs" ,
8588 type : "boolean" ,
86- description : "Splits audio into paragraphs to improve transcript readability" ,
89+ description :
90+ "Splits audio into paragraphs to improve transcript readability" ,
8791 value : false ,
8892 } ,
8993 {
@@ -113,19 +117,22 @@ export class Nova3Node extends ExecutableNode {
113117 {
114118 name : "measurements" ,
115119 type : "boolean" ,
116- description : "Convert spoken measurements to their corresponding abbreviations" ,
120+ description :
121+ "Convert spoken measurements to their corresponding abbreviations" ,
117122 value : false ,
118123 } ,
119124 {
120125 name : "language" ,
121126 type : "string" ,
122- description : "The BCP-47 language tag that hints at the primary spoken language" ,
127+ description :
128+ "The BCP-47 language tag that hints at the primary spoken language" ,
123129 value : "" ,
124130 } ,
125131 {
126132 name : "mode" ,
127133 type : "string" ,
128- description : "Mode of operation for the model (general, medical, finance)" ,
134+ description :
135+ "Mode of operation for the model (general, medical, finance)" ,
129136 value : "general" ,
130137 } ,
131138 {
@@ -149,7 +156,8 @@ export class Nova3Node extends ExecutableNode {
149156 {
150157 name : "keywords" ,
151158 type : "string" ,
152- description : "Keywords to boost or suppress specialized terminology and brands" ,
159+ description :
160+ "Keywords to boost or suppress specialized terminology and brands" ,
153161 value : "" ,
154162 } ,
155163 {
@@ -180,7 +188,8 @@ export class Nova3Node extends ExecutableNode {
180188 {
181189 name : "words" ,
182190 type : "json" ,
183- description : "Detailed word timing information with speaker assignments" ,
191+ description :
192+ "Detailed word timing information with speaker assignments" ,
184193 hidden : true ,
185194 } ,
186195 {
@@ -246,7 +255,7 @@ export class Nova3Node extends ExecutableNode {
246255 start ( controller ) {
247256 controller . enqueue ( audio . data ) ;
248257 controller . close ( ) ;
249- }
258+ } ,
250259 } ) ;
251260
252261 const params : any = {
@@ -257,17 +266,20 @@ export class Nova3Node extends ExecutableNode {
257266 } ;
258267
259268 // Add optional parameters only if they are provided and not default values
260- if ( detect_language !== undefined ) params . detect_language = detect_language ;
269+ if ( detect_language !== undefined )
270+ params . detect_language = detect_language ;
261271 if ( diarize !== undefined ) params . diarize = diarize ;
262272 if ( sentiment !== undefined ) params . sentiment = sentiment ;
263273 if ( topics !== undefined ) params . topics = topics ;
264- if ( detect_entities !== undefined ) params . detect_entities = detect_entities ;
274+ if ( detect_entities !== undefined )
275+ params . detect_entities = detect_entities ;
265276 if ( smart_format !== undefined ) params . smart_format = smart_format ;
266277 if ( punctuate !== undefined ) params . punctuate = punctuate ;
267278 if ( paragraphs !== undefined ) params . paragraphs = paragraphs ;
268279 if ( utterances !== undefined ) params . utterances = utterances ;
269280 if ( filler_words !== undefined ) params . filler_words = filler_words ;
270- if ( profanity_filter !== undefined ) params . profanity_filter = profanity_filter ;
281+ if ( profanity_filter !== undefined )
282+ params . profanity_filter = profanity_filter ;
271283 if ( numerals !== undefined ) params . numerals = numerals ;
272284 if ( measurements !== undefined ) params . measurements = measurements ;
273285 if ( language && language . trim ( ) ) params . language = language ;
@@ -276,8 +288,10 @@ export class Nova3Node extends ExecutableNode {
276288 if ( channels && channels !== 1 ) params . channels = channels ;
277289 if ( multichannel !== undefined ) params . multichannel = multichannel ;
278290 if ( keywords && keywords . trim ( ) ) params . keywords = keywords ;
279- if ( custom_topic && custom_topic . trim ( ) ) params . custom_topic = custom_topic ;
280- if ( custom_intent && custom_intent . trim ( ) ) params . custom_intent = custom_intent ;
291+ if ( custom_topic && custom_topic . trim ( ) )
292+ params . custom_topic = custom_topic ;
293+ if ( custom_intent && custom_intent . trim ( ) )
294+ params . custom_intent = custom_intent ;
281295
282296 // Call Cloudflare AI Nova-3 model
283297 const response = await context . env . AI . run (
@@ -294,7 +308,7 @@ export class Nova3Node extends ExecutableNode {
294308
295309 const channel = results . channels [ 0 ] ;
296310 const alternative = channel . alternatives ?. [ 0 ] ;
297-
311+
298312 if ( ! alternative ) {
299313 throw new Error ( "No transcription alternatives found in response" ) ;
300314 }
@@ -310,7 +324,7 @@ export class Nova3Node extends ExecutableNode {
310324 if ( results . summary ) {
311325 output . summary = results . summary ;
312326 }
313-
327+
314328 if ( results . sentiments ) {
315329 output . sentiments = results . sentiments ;
316330 }
0 commit comments