@@ -13,11 +13,11 @@ import { type ChatItemType, type UserChatItemValueItemType } from '@fastgpt/glob
1313import { parseFileExtensionFromUrl } from '@fastgpt/global/common/string/tools' ;
1414import { addLog } from '../../../../common/system/log' ;
1515import { addRawTextBuffer , getRawTextBuffer } from '../../../../common/buffer/rawText/controller' ;
16- import { addMinutes } from 'date-fns' ;
16+ import { addDays , addMinutes } from 'date-fns' ;
1717import { getNodeErrResponse } from '../utils' ;
1818import { isInternalAddress } from '../../../../common/system/utils' ;
1919import { replaceDatasetQuoteTextWithJWT } from '../../../dataset/utils' ;
20- import { ParsedFileContentS3Key } from '../../../../common/s3/utils' ;
20+ import { getFileNameFromPresignedURL , ParsedFileContentS3Key } from '../../../../common/s3/utils' ;
2121
2222type Props = ModuleDispatchProps < {
2323 [ NodeInputKeyEnum . fileUrlList ] : string [ ] ;
@@ -65,6 +65,23 @@ export const dispatchReadFiles = async (props: Props): Promise<Response> => {
6565 const filesFromHistories = version !== '489' ? [ ] : getHistoryFileLinks ( histories ) ;
6666
6767 try {
68+ console . dir (
69+ {
70+ urls : [ ...fileUrlList , ...filesFromHistories ] ,
71+ requestOrigin,
72+ maxFiles,
73+ teamId,
74+ tmbId,
75+ customPdfParse,
76+ usageId,
77+ fileS3Prefix : ParsedFileContentS3Key . chat ( {
78+ appId : props . runningAppInfo . id ,
79+ chatId : props . chatId ! ,
80+ uId : props . uid
81+ } )
82+ } ,
83+ { depth : null }
84+ ) ;
6885 const { text, readFilesResult } = await getFileContentFromLinks ( {
6986 // Concat fileUrlList and filesFromHistories; remove not supported files
7087 urls : [ ...fileUrlList , ...filesFromHistories ] ,
@@ -241,12 +258,12 @@ export const getFileContentFromLinks = async ({
241258 customPdfParse,
242259 getFormatText : true ,
243260 imageKeyOptions : {
244- prefix : fileS3Prefix
261+ prefix : ` ${ fileS3Prefix } / ${ getFileNameFromPresignedURL ( url ) } -parsed`
245262 } ,
246263 usageId
247264 } ) ;
248265
249- const replacedText = await replaceDatasetQuoteTextWithJWT ( rawText ) ;
266+ const replacedText = replaceDatasetQuoteTextWithJWT ( rawText , addDays ( new Date ( ) , 90 ) ) ;
250267
251268 // Add to buffer
252269 addRawTextBuffer ( {
0 commit comments