fix(kb.gbapp): Cleaning vector store before indexing.
This commit is contained in:
parent
26e7b4eec9
commit
eca5b4e81f
1 changed files with 9 additions and 4 deletions
|
@ -1101,10 +1101,15 @@ export class KBService implements IGBKBService {
|
|||
|
||||
GBLogEx.info(min, `Vectorizing ${files.length} file(s)...`);
|
||||
|
||||
// if (await GBUtil.exists(path.join(min['vectorStorePath'], 'args.json'))){
|
||||
// await min['vectorStore'].delete(min['vectorStorePath']);
|
||||
// }
|
||||
|
||||
if (await GBUtil.exists(min['vectorStorePath'])) {
|
||||
|
||||
GBLogEx.info(min, `Cleaning vector store: ${min['vectorStorePath']}...`)
|
||||
const gbkbPath = GBUtil.getGBAIPath(min.botId, 'gbkb');
|
||||
min['vectorStorePath'] = path.join('work', gbkbPath, 'docs-vectorized');
|
||||
min['vectorStore'] = await min.deployService.loadOrCreateEmptyVectorStore(min);
|
||||
|
||||
}
|
||||
|
||||
await CollectionUtil.asyncForEach(files, async file => {
|
||||
let content = null;
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue