fix(KBService): update file processing logic to include additional file types
All checks were successful
GBCI / build (push) Successful in 1m13s
All checks were successful
GBCI / build (push) Successful in 1m13s
This commit is contained in:
parent
0f0f8d610e
commit
4c28404578
1 changed files with 21 additions and 20 deletions
|
|
@ -1226,9 +1226,12 @@ export class KBService implements IGBKBService {
|
||||||
let skip = false;
|
let skip = false;
|
||||||
try {
|
try {
|
||||||
|
|
||||||
if (file.root.endsWith('.gbdata'))
|
if (file.name.endsWith('.csv') || file.name.endsWith('.md')
|
||||||
{
|
|| file.name.endsWith('.pdf') || file.name.endsWith('.docx') ||
|
||||||
skip = true;
|
file.name.endsWith('.epub') ||file.name.endsWith('.txt')
|
||||||
|
|
||||||
|
) {
|
||||||
|
|
||||||
if (file.name.endsWith('.csv')) {
|
if (file.name.endsWith('.csv')) {
|
||||||
skip = false;
|
skip = false;
|
||||||
// Read first 1000 lines of CSV file
|
// Read first 1000 lines of CSV file
|
||||||
|
|
@ -1237,8 +1240,6 @@ export class KBService implements IGBKBService {
|
||||||
await fs.writeFile(filePath, lines, 'utf8');
|
await fs.writeFile(filePath, lines, 'utf8');
|
||||||
content = lines;
|
content = lines;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
if (!skip){
|
|
||||||
|
|
||||||
const document = await this.loadAndSplitFile(filePath);
|
const document = await this.loadAndSplitFile(filePath);
|
||||||
// TODO: Add full filename.
|
// TODO: Add full filename.
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue