File tree 2 files changed +7
-2
lines changed 2 files changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -491,7 +491,12 @@ export class BlockService extends BaseService<
491
491
*/
492
492
async getDefaultNluPenaltyFactor ( ) : Promise < number > {
493
493
const settings : Settings = await this . settingService . getSettings ( ) ;
494
- return settings . chatbot_settings . default_nlu_penalty_factor ;
494
+ const nluPenaltyFactor =
495
+ settings . chatbot_settings . default_nlu_penalty_factor ;
496
+ if ( nluPenaltyFactor < 0 || nluPenaltyFactor > 1 ) {
497
+ this . logger . error ( 'NLU Penalty Factor must be between 0 and 1' ) ;
498
+ }
499
+ return nluPenaltyFactor ;
495
500
}
496
501
497
502
/**
Original file line number Diff line number Diff line change @@ -52,7 +52,7 @@ const removeDefaultNluPenaltyFactor = async ({ logger }: MigrationServices) => {
52
52
} ) ;
53
53
logger . log ( 'Successfuly removed the default NLU penalty factor setting' ) ;
54
54
} catch ( err ) {
55
- logger . error ( 'Unable to remove the default local storage helper setting' ) ;
55
+ logger . error ( 'Unable to remove the default NLU penalty factor setting' ) ;
56
56
}
57
57
} ;
58
58
You can’t perform that action at this time.
0 commit comments