This commit is contained in:
Mohamed Chedli Ben Yaghlane
2025-06-23 12:00:08 +01:00
committed by GitHub

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;
}
/**