diff --git a/.yarn/patches/@llm-tools-embedjs-loader-markdown-npm-0.1.25-d1d536d640.patch b/.yarn/patches/@llm-tools-embedjs-loader-markdown-npm-0.1.25-d1d536d640.patch new file mode 100644 index 000000000..7e9bb041f --- /dev/null +++ b/.yarn/patches/@llm-tools-embedjs-loader-markdown-npm-0.1.25-d1d536d640.patch @@ -0,0 +1,19 @@ +diff --git a/src/markdown-loader.js b/src/markdown-loader.js +index 8a17cb7f5a68d90d2be21682db6e95ce22a3e71c..9ee868ef9d4ff3dc914b3abc3c8006deb1e9c6c6 100644 +--- a/src/markdown-loader.js ++++ b/src/markdown-loader.js +@@ -1,5 +1,4 @@ + import { micromark } from 'micromark'; +-import { mdxJsx } from 'micromark-extension-mdx-jsx'; + import { gfmHtml, gfm } from 'micromark-extension-gfm'; + import createDebugMessages from 'debug'; + import fs from 'node:fs'; +@@ -21,7 +20,7 @@ export class MarkdownLoader extends BaseLoader { + ? (await getSafe(this.filePathOrUrl, { format: 'buffer' })).body + : await stream2buffer(fs.createReadStream(this.filePathOrUrl)); + this.debug('MarkdownLoader stream created'); +- const result = micromark(buffer, { extensions: [gfm(), mdxJsx()], htmlExtensions: [gfmHtml()] }); ++ const result = micromark(buffer, { extensions: [gfm()], htmlExtensions: [gfmHtml()] }); + this.debug('Markdown parsed...'); + const webLoader = new WebLoader({ + urlOrContent: result, diff --git a/package.json b/package.json index 11967d32a..d7b9ced57 100644 --- a/package.json +++ b/package.json @@ -53,7 +53,7 @@ "@llm-tools/embedjs": "patch:@llm-tools/embedjs@npm%3A0.1.25#~/.yarn/patches/@llm-tools-embedjs-npm-0.1.25-ec5645cf36.patch", "@llm-tools/embedjs-libsql": "patch:@llm-tools/embedjs-libsql@npm%3A0.1.25#~/.yarn/patches/@llm-tools-embedjs-libsql-npm-0.1.25-fad000d74c.patch", "@llm-tools/embedjs-loader-csv": "^0.1.25", - "@llm-tools/embedjs-loader-markdown": "^0.1.25", + "@llm-tools/embedjs-loader-markdown": "patch:@llm-tools/embedjs-loader-markdown@npm%3A0.1.25#~/.yarn/patches/@llm-tools-embedjs-loader-markdown-npm-0.1.25-d1d536d640.patch", "@llm-tools/embedjs-loader-msoffice": "^0.1.25", "@llm-tools/embedjs-loader-pdf": "^0.1.25", "@llm-tools/embedjs-loader-sitemap": "^0.1.25", diff --git a/src/main/services/KnowledgeService.ts b/src/main/services/KnowledgeService.ts index 2ca38a3ae..b8af2e74b 100644 --- a/src/main/services/KnowledgeService.ts +++ b/src/main/services/KnowledgeService.ts @@ -122,7 +122,7 @@ class KnowledgeService { return await ragApplication.addLoader(new ExcelLoader({ filePathOrUrl: file.path }) as any, forceReload) } - if (['.md', '.mdx'].includes(file.ext)) { + if (['.md'].includes(file.ext)) { return await ragApplication.addLoader(new MarkdownLoader({ filePathOrUrl: file.path }) as any, forceReload) } diff --git a/src/renderer/src/pages/knowledge/KnowledgeContent.tsx b/src/renderer/src/pages/knowledge/KnowledgeContent.tsx index ac7c94c33..43364d7ae 100644 --- a/src/renderer/src/pages/knowledge/KnowledgeContent.tsx +++ b/src/renderer/src/pages/knowledge/KnowledgeContent.tsx @@ -29,7 +29,7 @@ interface KnowledgeContentProps { selectedBase: KnowledgeBase } -const fileTypes = ['.pdf', '.docx', '.pptx', '.xlsx', '.txt', '.md', '.mdx'] +const fileTypes = ['.pdf', '.docx', '.pptx', '.xlsx', '.txt', '.md'] const FlexColumn = styled.div` display: flex;