Merge fixes and improvements (#1910)

Co-authored-by: tristanliu <tristanliu@tencent.com>
This commit is contained in:
Jun Zhang
2024-11-16 13:57:54 +08:00
committed by GitHub
parent 5e22b412c6
commit ba1938f04b
40 changed files with 1382 additions and 2784 deletions

View File

@@ -217,7 +217,11 @@ const MemorySection = ({ agentId }: Props) => {
};
const loadMemoryList = async (
{ filtersValue, current }: { filtersValue?: any; current?: number } = {},
{
filtersValue,
current,
pageSize,
}: { filtersValue?: any; current?: number; pageSize?: number } = {},
sort?: any,
) => {
if (!agentId) {
@@ -249,10 +253,11 @@ const MemorySection = ({ agentId }: Props) => {
agentId,
chatMemoryFilter: filtersValue || filters,
current: current || 1,
pageSize,
...sortParams,
});
setLoading(false);
const { list, total, pageSize, pageNum } = res.data;
const { list, total, pageNum } = res.data;
setDataSource(list);
setPagination({
pageSize,

View File

@@ -35,15 +35,20 @@ export function getMetricList(modelId: number) {
});
}
export function getMemeoryList(data: { agentId: number; chatMemoryFilter: any; current: number }) {
const { agentId, chatMemoryFilter, current } = data;
export function getMemeoryList(data: {
agentId: number;
chatMemoryFilter: any;
current: number;
pageSize: number;
}) {
const { agentId, chatMemoryFilter, current, pageSize } = data;
return request<Result<{ list: MetricType[] }>>('/api/chat/memory/pageMemories', {
method: 'POST',
data: {
...data,
chatMemoryFilter: { agentId, ...chatMemoryFilter },
current,
pageSize: 10,
pageSize: pageSize || 10,
sort: 'desc',
// orderCondition: 'updatedAt',
},