diff --git a/webapp/packages/chat-sdk/src/components/ChatItem/ParseTip.tsx b/webapp/packages/chat-sdk/src/components/ChatItem/ParseTip.tsx index 4a3302448..b23831cd2 100644 --- a/webapp/packages/chat-sdk/src/components/ChatItem/ParseTip.tsx +++ b/webapp/packages/chat-sdk/src/components/ChatItem/ParseTip.tsx @@ -300,7 +300,7 @@ const ParseTip: React.FC = ({ )} {parseInfoOptions?.length > 1 ? ':' : ''} - {parseInfoOptions?.length > 1 && ( + {!isSimpleMode && parseInfoOptions?.length > 1 && (
{parseInfoOptions.map((parseInfo, index) => (
void; }; const MarkDown: React.FC = ({ markdown, loading, onApplyAuth }) => { - // const { textResult } = data; const prefixCls = `${CLS_PREFIX}-markdown`; return ( diff --git a/webapp/packages/chat-sdk/src/components/ChatMsg/index.tsx b/webapp/packages/chat-sdk/src/components/ChatMsg/index.tsx index 0374d0087..6ba6ce51b 100644 --- a/webapp/packages/chat-sdk/src/components/ChatMsg/index.tsx +++ b/webapp/packages/chat-sdk/src/components/ChatMsg/index.tsx @@ -187,7 +187,11 @@ const ChatMsg: React.FC = ({ /> ); case MsgContentTypeEnum.MARKDOWN: - return ; + return ( +
+ +
+ ); default: return ( = ({ editAgent, onSaveAgent, onCancel }) => { const [saveLoading, setSaveLoading] = useState(false); const [examples, setExamples] = useState<{ id: string; question?: string }[]>([]); - const [formData, setFormData] = useState({}); + const [formData, setFormData] = useState({ + enableSearch: true, + llmConfig: { + timeOut: 60, + provider: 'OPEN_AI', + }, + }); const [form] = Form.useForm(); useEffect(() => { if (editAgent) { - form.setFieldsValue({ ...editAgent, enableSearch: editAgent.enableSearch !== 0 }); + const sourceData = { ...editAgent }; + if (!sourceData.llmConfig) { + delete sourceData.llmConfig; + } + form.setFieldsValue({ ...sourceData, enableSearch: editAgent.enableSearch !== 0 }); if (editAgent.examples) { setExamples(editAgent.examples.map((question) => ({ id: uuid(), question }))); } @@ -173,7 +183,7 @@ const AgentModal: React.FC = ({ editAgent, onSaveAgent, onCancel }) => { - + = ({ editAgent, onSaveAgent, onCancel }) => {
{ setFormData(values); }} diff --git a/webapp/packages/supersonic-fe/src/pages/Agent/ToolModal.tsx b/webapp/packages/supersonic-fe/src/pages/Agent/ToolModal.tsx index 9024b6398..5c3c03949 100644 --- a/webapp/packages/supersonic-fe/src/pages/Agent/ToolModal.tsx +++ b/webapp/packages/supersonic-fe/src/pages/Agent/ToolModal.tsx @@ -1,4 +1,4 @@ -import { Form, Modal, Input, Select, Button, TreeSelect } from 'antd'; +import { Form, Modal, Input, Select, Button, TreeSelect, message } from 'antd'; import { AgentToolType, AgentToolTypeEnum, @@ -32,14 +32,12 @@ const ToolModal: React.FC = ({ editTool, onSaveTool, onCancel }) => { const [form] = Form.useForm(); const initModelList = async () => { - const res = await getModelList(); - const treeData = traverseTree(res.data, (node: any) => { - node.title = node.name; - node.value = node.type === 'DOMAIN' ? `DOMAIN_${node.id}` : node.id; - node.checkable = - node.type === 'DATASET' || (node.type === 'DOMAIN' && node.children?.length > 0); - }); - setModelList([{ title: '默认', value: -1, type: 'DATASET' }, ...treeData]); + const { code, data } = await getModelList(); + if (code === 200) { + setModelList([{ name: '默认', id: -1 }, ...data]); + } else { + message.error('获取模型列表失败!'); + } }; const initPluginList = async () => { @@ -106,11 +104,10 @@ const ToolModal: React.FC = ({ editTool, onSaveTool, onCancel }) => { {(toolType === AgentToolTypeEnum.NL2SQL_RULE || toolType === AgentToolTypeEnum.NL2SQL_LLM) && ( - ({ label: item.name, value: item.id }))} placeholder="请选择数据集" - multiple - treeCheckable + mode="multiple" allowClear /> diff --git a/webapp/packages/supersonic-fe/src/pages/Agent/ToolsSection.tsx b/webapp/packages/supersonic-fe/src/pages/Agent/ToolsSection.tsx index 9149ba945..82e130e50 100644 --- a/webapp/packages/supersonic-fe/src/pages/Agent/ToolsSection.tsx +++ b/webapp/packages/supersonic-fe/src/pages/Agent/ToolsSection.tsx @@ -111,34 +111,38 @@ const ToolsSection: React.FC = ({ currentAgent, onSaveAgent, onEditAgent, -
-
大模型信息
-
-
- 模型提供方式: - {currentAgent?.llmConfig?.provider} -
-
- 大模型名称: - {currentAgent?.llmConfig?.modelName} -
-
- Base URL: - {currentAgent?.llmConfig?.baseUrl} -
-
- API KEY: - {currentAgent?.llmConfig?.apiKey} -
-
- 回复随机性: - {currentAgent?.llmConfig?.temperature} -
-
- 超时时间(秒): {currentAgent?.llmConfig?.timeOut} + {currentAgent?.llmConfig && ( +
+
大模型信息
+
+
+ 模型提供方式: + {currentAgent?.llmConfig?.provider} +
+
+ 大模型名称: + {currentAgent?.llmConfig?.modelName} +
+
+ Base URL: + {currentAgent?.llmConfig?.baseUrl} +
+
+ API KEY: + {currentAgent?.llmConfig?.apiKey} +
+
+ Temperature: + {currentAgent?.llmConfig?.temperature} +
+
+ 超时时间(秒): {' '} + {currentAgent?.llmConfig?.timeOut} +
-
+ )} +
工具
diff --git a/webapp/packages/supersonic-fe/src/pages/SemanticModel/Datasource/components/ModelFieldForm.tsx b/webapp/packages/supersonic-fe/src/pages/SemanticModel/Datasource/components/ModelFieldForm.tsx index 99ad7a6c4..949fee58f 100644 --- a/webapp/packages/supersonic-fe/src/pages/SemanticModel/Datasource/components/ModelFieldForm.tsx +++ b/webapp/packages/supersonic-fe/src/pages/SemanticModel/Datasource/components/ModelFieldForm.tsx @@ -141,7 +141,7 @@ const ModelFieldForm: React.FC = ({