UNPKG

@lobehub/chat

Version:

Lobe Chat - an open-source, high-performance chatbot framework that supports speech synthesis, multimodal, and extensible Function Call plugin system. Supports one-click free deployment of your private ChatGPT/LLM web application.

14 lines (9 loc) 472 B
import { DocxLoader as Loader } from '@langchain/community/document_loaders/fs/docx'; import { RecursiveCharacterTextSplitter } from 'langchain/text_splitter'; import { loaderConfig } from '../config'; export const DocxLoader = async (fileBlob: Blob | string) => { const loader = new Loader(fileBlob); const splitter = new RecursiveCharacterTextSplitter(loaderConfig); const documents = await loader.load(); return await splitter.splitDocuments(documents); };