Feat: Add metadata configuration for new chats #3221 (#9502)

### What problem does this PR solve?

Feat: Add metadata configuration for new chats #3221

### Type of change


- [x] New Feature (non-breaking change which adds functionality)
This commit is contained in:
balibabu
2025-08-15 17:40:16 +08:00
committed by GitHub
parent eef43fa25c
commit 799c57287c
15 changed files with 269 additions and 187 deletions

View File

@ -138,7 +138,8 @@ export const useSendMessage = (controller: AbortController) => {
const { conversationId, isNew } = useGetChatSearchParams();
const { handleInputChange, value, setValue } = useHandleMessageInputChange();
const { handleUploadFile, fileIds, clearFileIds } = useUploadFile();
const { handleUploadFile, fileIds, clearFileIds, isUploading } =
useUploadFile();
const { send, answer, done } = useSendMessageWithSse(
api.completeConversation,
@ -285,5 +286,6 @@ export const useSendMessage = (controller: AbortController) => {
removeMessageById,
stopOutputMessage,
handleUploadFile,
isUploading,
};
};

View File

@ -3,7 +3,7 @@ import { useUploadAndParseFile } from '@/hooks/use-chat-request';
import { useCallback, useState } from 'react';
export function useUploadFile() {
const { uploadAndParseFile } = useUploadAndParseFile();
const { uploadAndParseFile, loading } = useUploadAndParseFile();
const [fileIds, setFileIds] = useState<string[]>([]);
const handleUploadFile: NonNullable<FileUploadProps['onUpload']> =
@ -23,5 +23,5 @@ export function useUploadFile() {
setFileIds([]);
}, []);
return { handleUploadFile, clearFileIds, fileIds };
return { handleUploadFile, clearFileIds, fileIds, isUploading: loading };
}