Skip to content

Commit 3672938

Browse files
author
MohamedAliBouhaouala
committed
fix: retailor log messages
1 parent c2f3569 commit 3672938

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

api/src/chat/services/block.service.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -491,7 +491,12 @@ export class BlockService extends BaseService<
491491
*/
492492
async getDefaultNluPenaltyFactor(): Promise<number> {
493493
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;
495500
}
496501

497502
/**

api/src/migration/migrations/1745594957327-v-2-2-6.migration.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ const removeDefaultNluPenaltyFactor = async ({ logger }: MigrationServices) => {
5252
});
5353
logger.log('Successfuly removed the default NLU penalty factor setting');
5454
} 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');
5656
}
5757
};
5858

0 commit comments

Comments
 (0)