File tree Expand file tree Collapse file tree
packages/service/core/dataset/apiDataset/custom Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ import { readFileRawTextByUrl } from '../../read';
1111import { type ParentIdType } from '@fastgpt/global/common/parentFolder/type' ;
1212import { type RequireOnlyOne } from '@fastgpt/global/common/type/utils' ;
1313import { getS3RawTextSource } from '../../../../common/s3/sources/rawText' ;
14+ import { getNanoid } from '@fastgpt/global/common/string/tools' ;
1415
1516type ResponseDataType = {
1617 success : boolean ;
@@ -176,15 +177,17 @@ export const useApiDatasetRequest = ({ apiServer }: { apiServer: APIFileServer }
176177 getFormatText : true
177178 } ) ;
178179
180+ const sourceName = title || getNanoid ( ) ;
181+
179182 getS3RawTextSource ( ) . addRawTextBuffer ( {
180183 sourceId : previewUrl ,
181- sourceName : title || '' ,
184+ sourceName,
182185 text : rawText ,
183186 customPdfParse
184187 } ) ;
185188
186189 return {
187- title,
190+ title : sourceName ,
188191 rawText
189192 } ;
190193 }
You can’t perform that action at this time.
0 commit comments