Add img extension (#2172)

* perf: mongo log

* perf: img read

* doc
This commit is contained in:
Archer
2024-07-26 12:46:07 +08:00
committed by GitHub
parent 2d1e53c3b5
commit 8d25a1d3ec
11 changed files with 35 additions and 31 deletions

View File

@@ -8,7 +8,8 @@ import fs from 'fs';
import { detectFileEncoding } from '@fastgpt/global/common/file/tools';
import type { ReadFileResponse } from '../../../worker/readFile/type';
export const initMarkdownText = ({
// match md img text and upload to db
export const matchMdImgTextAndUpload = ({
teamId,
md,
metadata
@@ -79,7 +80,7 @@ export const readRawContentByFileBuffer = async ({
// markdown data format
if (['md', 'html', 'docx'].includes(extension)) {
rawText = await initMarkdownText({
rawText = await matchMdImgTextAndUpload({
teamId: teamId,
md: rawText,
metadata: metadata