This commit is contained in:
Mohamed Chedli Ben Yaghlane 2025-06-23 12:00:08 +01:00 committed by GitHub
commit e015a06661
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -118,15 +118,15 @@ export class BlockService extends BaseService<
*/
private async getPenaltyFactor(): Promise<number> {
const settings = await this.settingService.getSettings();
const configured = settings.chatbot_settings?.default_nlu_penalty_factor;
const nluPenaltyFactor =
settings.chatbot_settings?.default_nlu_penalty_factor;
if (configured == null) {
if (nluPenaltyFactor == null) {
this.logger.warn(
'Using fallback NLU penalty factor value: %s',
FALLBACK_DEFAULT_NLU_PENALTY_FACTOR,
`The NLU penalty factor has reverted to its default fallback value of: ${FALLBACK_DEFAULT_NLU_PENALTY_FACTOR}`,
);
}
return configured ?? FALLBACK_DEFAULT_NLU_PENALTY_FACTOR;
return nluPenaltyFactor ?? FALLBACK_DEFAULT_NLU_PENALTY_FACTOR;
}
/**