mirror of
https://github.com/labring/FastGPT.git
synced 2025-07-23 21:13:50 +00:00

* perf: plan tip * perf: upload size controller * feat: add image ttl index * feat: new upload file ux * remove file * feat: support read pptx * feat: support xlsx * fix: rerank docker flie
24 lines
570 B
TypeScript
24 lines
570 B
TypeScript
import { ReadFileByBufferParams, ReadFileResponse } from './type.d';
|
|
import { initMarkdownText } from './utils';
|
|
import { htmlToMarkdown } from '../../string/markdown';
|
|
import { readFileRawText } from './rawText';
|
|
|
|
export const readHtmlRawText = async (
|
|
params: ReadFileByBufferParams
|
|
): Promise<ReadFileResponse> => {
|
|
const { teamId, metadata } = params;
|
|
const { rawText: html } = readFileRawText(params);
|
|
|
|
const md = await htmlToMarkdown(html);
|
|
|
|
const rawText = await initMarkdownText({
|
|
teamId,
|
|
md,
|
|
metadata
|
|
});
|
|
|
|
return {
|
|
rawText
|
|
};
|
|
};
|