From f096c44de09e06e25476b316c3d9c8192dc9b023 Mon Sep 17 00:00:00 2001 From: williamhliu <137068196+williamhliu@users.noreply.github.com> Date: Sat, 29 Jun 2024 16:47:14 +0800 Subject: [PATCH] (feature)(supersonic-fe) add memory manage to agent (#1284) --- .../src/components/ChatItem/SqlItem.tsx | 4 +- .../src/pages/Agent/MemorySection.tsx | 24 +++++- .../src/pages/ChatPlugin/DetailModal.tsx | 73 +++++++++++++------ .../src/pages/ChatPlugin/service.ts | 14 ++-- .../src/pages/ChatPlugin/type.ts | 1 + 5 files changed, 79 insertions(+), 37 deletions(-) diff --git a/webapp/packages/chat-sdk/src/components/ChatItem/SqlItem.tsx b/webapp/packages/chat-sdk/src/components/ChatItem/SqlItem.tsx index 7c898a610..21cbfd9ba 100644 --- a/webapp/packages/chat-sdk/src/components/ChatItem/SqlItem.tsx +++ b/webapp/packages/chat-sdk/src/components/ChatItem/SqlItem.tsx @@ -187,9 +187,7 @@ const SqlItem: React.FC = ({
问题:
-
- {item.questionAugmented} -
+
{item.question}
SQL:
diff --git a/webapp/packages/supersonic-fe/src/pages/Agent/MemorySection.tsx b/webapp/packages/supersonic-fe/src/pages/Agent/MemorySection.tsx index f01249415..a9379ecae 100644 --- a/webapp/packages/supersonic-fe/src/pages/Agent/MemorySection.tsx +++ b/webapp/packages/supersonic-fe/src/pages/Agent/MemorySection.tsx @@ -3,10 +3,11 @@ import { EditableProTable } from '@ant-design/pro-components'; import React, { useState } from 'react'; import { MemoryType, ReviewEnum, StatusEnum } from './type'; import { getMemeoryList, saveMemory } from './service'; -import { Popover, Input, Badge } from 'antd'; +import { Popover, Input, Badge, Radio } from 'antd'; import styles from './style.less'; const { TextArea } = Input; +const RadioGroup = Radio.Group; const MemorySection = () => { const [editableKeys, setEditableRowKeys] = useState([]); @@ -24,12 +25,18 @@ const MemorySection = () => { dataIndex: 'dbSchema', width: 300, valueType: 'textarea', + renderFormItem: (_, { record }) => ( +