Feat: Files uploaded via the dialog box can be uploaded without binding to a dataset. #9590 (#11630)

### What problem does this PR solve?

Feat: Files uploaded via the dialog box can be uploaded without binding
to a dataset. #9590

### Type of change


- [x] New Feature (non-breaking change which adds functionality)
This commit is contained in:
balibabu
2025-12-01 16:29:02 +08:00
committed by GitHub
parent 221947acc4
commit 1120575021
11 changed files with 60 additions and 466 deletions

View File

@ -86,7 +86,7 @@ export const useSendMessage = (controller: AbortController) => {
const { conversationId, isNew } = useGetChatSearchParams();
const { handleInputChange, value, setValue } = useHandleMessageInputChange();
const { handleUploadFile, fileIds, clearFileIds, isUploading, removeFile } =
const { handleUploadFile, isUploading, removeFile, files, clearFiles } =
useUploadFile();
const { send, answer, done } = useSendMessageWithSse(
@ -208,7 +208,7 @@ export const useSendMessage = (controller: AbortController) => {
addNewestQuestion({
content: value,
doc_ids: fileIds,
files: files,
id,
role: MessageType.User,
});
@ -218,16 +218,16 @@ export const useSendMessage = (controller: AbortController) => {
id,
content: value.trim(),
role: MessageType.User,
doc_ids: fileIds,
files: files,
});
}
clearFileIds();
clearFiles();
}, [
value,
addNewestQuestion,
fileIds,
files,
done,
clearFileIds,
clearFiles,
setValue,
handleSendMessage,
]);