mirror of
https://github.com/csunny/DB-GPT.git
synced 2025-09-13 21:21:08 +00:00
feat(ChatExcel): Better Chat Excel (#2423)
This commit is contained in:
@@ -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,
|
||||
|
Reference in New Issue
Block a user