4.8-alpha fix (#1424)

This commit is contained in:
Archer
2024-05-09 22:48:44 +08:00
committed by GitHub
parent 6463427d93
commit 434af56abd
19 changed files with 255 additions and 148 deletions

View File

@@ -55,6 +55,8 @@ const MessageInput = ({
const { t } = useTranslation();
const havInput = !!inputValue || fileList.length > 0;
const hasFileUploading = fileList.some((item) => !item.url);
const canSendMessage = havInput && !hasFileUploading;
/* file selector and upload */
const { File, onOpen: onOpenSelectFile } = useSelectFile({
@@ -142,7 +144,8 @@ const MessageInput = ({
);
/* on send */
const handleSend = useCallback(async () => {
const handleSend = async () => {
if (!canSendMessage) return;
const textareaValue = TextareaDom.current?.value || '';
onSendMessage({
@@ -150,7 +153,7 @@ const MessageInput = ({
files: fileList
});
replaceFile([]);
}, [TextareaDom, fileList, onSendMessage, replaceFile]);
};
/* whisper init */
const {
@@ -466,16 +469,20 @@ const MessageInput = ({
h={['28px', '32px']}
w={['28px', '32px']}
borderRadius={'md'}
bg={isSpeaking || isChatting ? '' : !havInput ? '#E5E5E5' : 'primary.500'}
bg={
isSpeaking || isChatting
? ''
: !havInput || hasFileUploading
? '#E5E5E5'
: 'primary.500'
}
cursor={havInput ? 'pointer' : 'not-allowed'}
lineHeight={1}
onClick={() => {
if (isChatting) {
return onStop();
}
if (havInput) {
return handleSend();
}
return handleSend();
}}
>
{isChatting ? (

View File

@@ -53,7 +53,7 @@ const Markdown = ({
);
const formatSource = source
.replace(/\\n/g, '\n ')
// .replace(/\\n/g, '\n')
.replace(/(http[s]?:\/\/[^\s。]+)([。,])/g, '$1 $2')
.replace(/\n*(\[QUOTE SIGN\]\(.*\))/g, '$1');

View File

@@ -40,3 +40,9 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse<
res.status(500).send(getErrText(err));
}
}
export const config = {
api: {
responseLimit: '16mb'
}
};

View File

@@ -362,12 +362,6 @@ async function handler(req: NextApiRequest, res: NextApiResponse) {
}
export default NextAPI(handler);
export const config = {
api: {
responseLimit: '20mb'
}
};
const authShareChat = async ({
chatId,
...data
@@ -526,3 +520,9 @@ const authHeaderRequest = async ({
canWrite
};
};
export const config = {
api: {
responseLimit: '20mb'
}
};

View File

@@ -28,7 +28,7 @@ export default React.memo(FileLocal);
const csvTemplate = `"第一列内容","第二列内容"
"必填列","可选列。CSV 中请注意内容不能包含双引号,双引号是列分割符号"
"只会第一和第二列内容导入,其余列会被忽略",""
"只会第一和第二列内容导入,其余列会被忽略",""
"结合人工智能的演进历程,AIGC的发展大致可以分为三个阶段即:早期萌芽阶段(20世纪50年代至90年代中期)、沉淀积累阶段(20世纪90年代中期至21世纪10年代中期),以及快速发展展阶段(21世纪10年代中期至今)。",""
"AIGC发展分为几个阶段","早期萌芽阶段(20世纪50年代至90年代中期)、沉淀积累阶段(20世纪90年代中期至21世纪10年代中期)、快速发展展阶段(21世纪10年代中期至今)"`;

View File

@@ -32,7 +32,7 @@ export const useSearchTestStore = create<State>()(
datasetTestList: [],
pushDatasetTestItem(data) {
set((state) => {
state.datasetTestList = [data, ...state.datasetTestList].slice(0, 100);
state.datasetTestList = [data, ...state.datasetTestList].slice(0, 50);
});
},
delDatasetTestItemById(id) {