mirror of
https://github.com/labring/FastGPT.git
synced 2026-02-27 01:02:22 +08:00
fix: set fallback file name while import documents from other api server (#6372)
* fix: deps * fix: set fallback file name while import documents from other api server
This commit is contained in:
@@ -11,6 +11,7 @@ import { readFileRawTextByUrl } from '../../read';
|
||||
import { type ParentIdType } from '@fastgpt/global/common/parentFolder/type';
|
||||
import { type RequireOnlyOne } from '@fastgpt/global/common/type/utils';
|
||||
import { getS3RawTextSource } from '../../../../common/s3/sources/rawText';
|
||||
import { getNanoid } from '@fastgpt/global/common/string/tools';
|
||||
|
||||
type ResponseDataType = {
|
||||
success: boolean;
|
||||
@@ -176,15 +177,17 @@ export const useApiDatasetRequest = ({ apiServer }: { apiServer: APIFileServer }
|
||||
getFormatText: true
|
||||
});
|
||||
|
||||
const sourceName = title || getNanoid();
|
||||
|
||||
getS3RawTextSource().addRawTextBuffer({
|
||||
sourceId: previewUrl,
|
||||
sourceName: title || '',
|
||||
sourceName,
|
||||
text: rawText,
|
||||
customPdfParse
|
||||
});
|
||||
|
||||
return {
|
||||
title,
|
||||
title: sourceName,
|
||||
rawText
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user