fix(api): add support to llm-nlu helper

This commit is contained in:
yassinedorbozgithub 2025-05-30 13:33:46 +01:00
parent 78c0b05021
commit 26166e05e4
3 changed files with 7 additions and 0 deletions

View File

@ -38,6 +38,7 @@ export class AttachmentModule implements OnApplicationBootstrap {
if (!AppInstance.isReady()) {
return;
}
// Ensure the directories exists
if (!existsSync(config.parameters.uploadDir)) {
mkdirSync(config.parameters.uploadDir, { recursive: true });

View File

@ -28,6 +28,7 @@ export class ExtensionModule implements OnApplicationBootstrap {
if (!AppInstance.isReady()) {
return;
}
try {
await this.cleanupService.pruneExtensionSettings();
} catch (error) {

View File

@ -10,6 +10,7 @@ import { Injectable, OnApplicationBootstrap } from '@nestjs/common';
import { OnEvent } from '@nestjs/event-emitter';
import Handlebars from 'handlebars';
import { AppInstance } from '@/app.instance';
import { HelperService } from '@/helper/helper.service';
import BaseNlpHelper from '@/helper/lib/base-nlp-helper';
import { HelperType, LLM, NLU } from '@/helper/types';
@ -89,6 +90,10 @@ export default class LlmNluHelper
}
async onApplicationBootstrap() {
if (!AppInstance.isReady()) {
return;
}
try {
this.logger.log('Initializing LLM NLU helper, building prompts...');
// Build prompts for language and trait classifiers