Spaces:
Sleeping
Sleeping
| // hf-space/src/lib/knowledge/parser/docx.ts | |
| import mammoth from 'mammoth'; | |
| import type { ParsedDocument } from './index'; | |
| export async function parseDOCX(buffer: Buffer): Promise<ParsedDocument> { | |
| const result = await mammoth.extractRawText({ buffer }); | |
| return { | |
| content: result.value, | |
| }; | |
| } | |