fix: retailor log messages

This commit is contained in:
MohamedAliBouhaouala 2025-04-28 17:17:27 +01:00
parent 4c9f7b470f
commit 384e777fa4
2 changed files with 7 additions and 2 deletions

View File

@ -491,7 +491,12 @@ export class BlockService extends BaseService<
*/
async getDefaultNluPenaltyFactor(): Promise<number> {
const settings: Settings = await this.settingService.getSettings();
return settings.chatbot_settings.default_nlu_penalty_factor;
const nluPenaltyFactor =
settings.chatbot_settings.default_nlu_penalty_factor;
if (nluPenaltyFactor < 0 || nluPenaltyFactor > 1) {
this.logger.error('NLU Penalty Factor must be between 0 and 1');
}
return nluPenaltyFactor;
}
/**

View File

@ -52,7 +52,7 @@ const removeDefaultNluPenaltyFactor = async ({ logger }: MigrationServices) => {
});
logger.log('Successfuly removed the default NLU penalty factor setting');
} catch (err) {
logger.error('Unable to remove the default local storage helper setting');
logger.error('Unable to remove the default NLU penalty factor setting');
}
};