fix(KBService): standardize formatting and improve code readability
All checks were successful
GBCI / build (push) Successful in 1m1s
All checks were successful
GBCI / build (push) Successful in 1m1s
This commit is contained in:
parent
53710da2a7
commit
e2382ccddc
1 changed files with 47 additions and 46 deletions
|
|
@ -1087,7 +1087,7 @@ export class KBService implements IGBKBService {
|
||||||
'--no-default-browser-check'
|
'--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);
|
const page = await this.getFreshPage(browser, website);
|
||||||
|
|
||||||
let logo = await this.getLogoByPage(min, page);
|
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'));
|
const gbdata = path.join(process.env.PWD, 'work', GBUtil.getGBAIPath(min.botId, 'gbdata'));
|
||||||
files = files.concat(await walkPromise(gbdata));
|
files = files.concat(await walkPromise(gbdata));
|
||||||
|
|
||||||
|
|
||||||
if (files[0]) {
|
if (files[0]) {
|
||||||
|
|
||||||
|
files = files.filter(p => { return p });
|
||||||
shouldSave = true;
|
shouldSave = true;
|
||||||
GBLogEx.info(min, `Add embeddings from packages, ${files.length} files being processed...`);
|
GBLogEx.info(min, `Add embeddings from packages, ${files.length} files being processed...`);
|
||||||
await CollectionUtil.asyncForEach(files, async file => {
|
await CollectionUtil.asyncForEach(files, async file => {
|
||||||
|
|
@ -1253,7 +1254,7 @@ export class KBService implements IGBKBService {
|
||||||
|
|
||||||
if (file.name.endsWith('.csv') || file.name.endsWith('.md')
|
if (file.name.endsWith('.csv') || file.name.endsWith('.md')
|
||||||
|| file.name.endsWith('.pdf') || file.name.endsWith('.docx') ||
|
|| file.name.endsWith('.pdf') || file.name.endsWith('.docx') ||
|
||||||
file.name.endsWith('.epub') ||file.name.endsWith('.txt')
|
file.name.endsWith('.epub') || file.name.endsWith('.txt')
|
||||||
|
|
||||||
) {
|
) {
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue