fix(KBService): standardize formatting and improve code readability
All checks were successful
GBCI / build (push) Successful in 1m1s

This commit is contained in:
Rodrigo Rodriguez (Pragmatismo) 2025-05-22 18:56:30 -03:00
parent 53710da2a7
commit e2382ccddc

View file

@ -1087,7 +1087,7 @@ export class KBService implements IGBKBService {
'--no-default-browser-check'
];
let browser = await puppeteer.launch({ headless: false , args});
let browser = await puppeteer.launch({ headless: false, args });
const page = await this.getFreshPage(browser, website);
let logo = await this.getLogoByPage(min, page);
@ -1239,8 +1239,9 @@ export class KBService implements IGBKBService {
const gbdata = path.join(process.env.PWD, 'work', GBUtil.getGBAIPath(min.botId, 'gbdata'));
files = files.concat(await walkPromise(gbdata));
if (files[0]) {
files = files.filter(p => { return p });
shouldSave = true;
GBLogEx.info(min, `Add embeddings from packages, ${files.length} files being processed...`);
await CollectionUtil.asyncForEach(files, async file => {
@ -1253,7 +1254,7 @@ export class KBService implements IGBKBService {
if (file.name.endsWith('.csv') || file.name.endsWith('.md')
|| file.name.endsWith('.pdf') || file.name.endsWith('.docx') ||
file.name.endsWith('.epub') ||file.name.endsWith('.txt')
file.name.endsWith('.epub') || file.name.endsWith('.txt')
) {