feat(ChatExcel): Better Chat Excel (#2423)

This commit is contained in:
Fangyin Cheng
2025-03-10 11:37:32 +08:00
committed by GitHub
parent 75c1454938
commit 93eb3a786c
202 changed files with 1862 additions and 751 deletions

View File

@@ -1,5 +1,6 @@
import { ChatContext } from '@/app/chat-context';
import { apiInterceptors, postChatModeParamsFileLoad } from '@/client/api';
import { ChatContentContext } from '@/pages/chat';
import { LinkOutlined, SelectOutlined, UploadOutlined } from '@ant-design/icons';
import { Button, Tooltip, Upload, UploadFile, UploadProps, message } from 'antd';
import { PropsWithChildren, useContext, useState } from 'react';
@@ -17,6 +18,8 @@ function ExcelUpload({ convUid, chatMode, onComplete, ...props }: PropsWithChild
const [percent, setPercent] = useState<number>();
const { model } = useContext(ChatContext);
const { temperatureValue, maxNewTokensValue } = useContext(ChatContentContext);
const onChange: UploadProps['onChange'] = async info => {
if (!info) {
message.error('Please select the *.(csv|xlsx|xls) file');
@@ -42,6 +45,8 @@ function ExcelUpload({ convUid, chatMode, onComplete, ...props }: PropsWithChild
chatMode,
data: formData,
model,
temperatureValue,
maxNewTokensValue,
config: {
/** timeout 1h */
timeout: 1000 * 60 * 60,