File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -203,6 +203,8 @@ export function ChatPage({
203
203
refetch : refetchFederatedConnectors ,
204
204
} = useFederatedOAuthStatus ( ) ;
205
205
206
+ const [ messageFiles , setMessageFiles ] = useState < FileDescriptor [ ] > ( [ ] ) ;
207
+
206
208
// Also fetch federated connectors for the sources list
207
209
const { data : federatedConnectorsData } = useFederatedConnectors ( ) ;
208
210
@@ -1238,6 +1240,13 @@ export function ChatPage({
1238
1240
// If under the context limit, the files will be included in the chat history
1239
1241
// so we don't need to keep them around.
1240
1242
if ( selectedDocumentTokens < maxTokens ) {
1243
+ setMessageFiles (
1244
+ selectedFiles . map ( ( selectedFile ) => ( {
1245
+ id : selectedFile . id . toString ( ) ,
1246
+ type : selectedFile . chat_file_type ,
1247
+ name : selectedFile . name ,
1248
+ } ) )
1249
+ ) ;
1241
1250
setSelectedFiles ( [ ] ) ;
1242
1251
}
1243
1252
@@ -3357,6 +3366,7 @@ export function ChatPage({
3357
3366
key = { - 2 }
3358
3367
messageId = { - 1 }
3359
3368
content = { submittedMessage }
3369
+ files = { messageFiles }
3360
3370
/>
3361
3371
) }
3362
3372
You can’t perform that action at this time.
0 commit comments