mirror of
https://github.com/tencentmusic/supersonic.git
synced 2025-12-10 19:51:00 +00:00
Merge pull request #1290 from williamhliu/master
(fix)(supersonic-fe) fix add agent error
This commit is contained in:
@@ -277,7 +277,7 @@ const AgentForm: React.FC<Props> = ({ editAgent, onSaveAgent, onCreateToolBtnCli
|
||||
{
|
||||
label: '记忆管理',
|
||||
key: 'memory',
|
||||
children: <MemorySection agentId={editAgent!.id!} />,
|
||||
children: <MemorySection agentId={editAgent?.id} />,
|
||||
},
|
||||
];
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ const { TextArea, Search } = Input;
|
||||
const RadioGroup = Radio.Group;
|
||||
|
||||
type Props = {
|
||||
agentId: number;
|
||||
agentId?: number;
|
||||
};
|
||||
|
||||
const MemorySection = ({ agentId }: Props) => {
|
||||
@@ -166,6 +166,13 @@ const MemorySection = ({ agentId }: Props) => {
|
||||
filtersValue,
|
||||
current,
|
||||
}: { filtersValue?: any; current?: number } = {}) => {
|
||||
if (!agentId) {
|
||||
return {
|
||||
data: [],
|
||||
total: 0,
|
||||
success: true,
|
||||
};
|
||||
}
|
||||
setLoading(true);
|
||||
const res = await getMemeoryList(agentId, filtersValue || filters, current || 1);
|
||||
setLoading(false);
|
||||
|
||||
Reference in New Issue
Block a user