+
diff --git a/web/src/views/MemoryExtractionEngine/index.tsx b/web/src/views/MemoryExtractionEngine/index.tsx
index 3d67270c..96138a55 100644
--- a/web/src/views/MemoryExtractionEngine/index.tsx
+++ b/web/src/views/MemoryExtractionEngine/index.tsx
@@ -1,14 +1,14 @@
import { type FC, useState, useEffect } from 'react'
import { useTranslation } from 'react-i18next'
import { useParams } from 'react-router-dom'
-import { Row, Col, Space, Switch, Select, InputNumber, Slider, App, Form } from 'antd'
+import { Row, Col, Space, Select, InputNumber, Slider, App, Form } from 'antd'
import clsx from 'clsx'
import Card from './components/Card'
import type { ConfigForm, Variable } from './types'
import { getMemoryExtractionConfig, updateMemoryExtractionConfig } from '@/api/memory'
import Markdown from '@/components/Markdown'
import { getModelList } from '@/api/models';
-import type { Model } from '@/views/ModelManagement/types'
+import type { ModelListItem } from '@/views/ModelManagement/types'
import { configList } from './constant'
import Result from './components/Result'
import SwitchFormItem from '@/components/FormItem/SwitchFormItem'
@@ -43,7 +43,7 @@ const MemoryExtractionEngine: FC = () => {
const values = Form.useWatch
([], form)
const [loading, setLoading] = useState(false)
const [iterationPeriodDisabled, setIterationPeriodDisabled] = useState(false)
- const [modelList, setModelList] = useState([])
+ const [modelList, setModelList] = useState([])
useEffect(() => {
if (values?.reflexion_range === 'database') {
@@ -55,9 +55,9 @@ const MemoryExtractionEngine: FC = () => {
}, [values])
const getModels = () => {
- getModelList({ type: 'llm,chat', pagesize: 100, page: 1 })
+ getModelList({ type: 'llm,chat', pagesize: 100, page: 1, is_active: true })
.then(res => {
- const response = res as { items: Model[] }
+ const response = res as { items: ModelListItem[] }
setModelList(response.items)
})
}
diff --git a/web/src/views/ModelManagement/Group.tsx b/web/src/views/ModelManagement/Group.tsx
new file mode 100644
index 00000000..311455b4
--- /dev/null
+++ b/web/src/views/ModelManagement/Group.tsx
@@ -0,0 +1,97 @@
+import { useState, useEffect, forwardRef, useImperativeHandle } from 'react';
+import clsx from 'clsx'
+import { Button } from 'antd'
+import { useTranslation } from 'react-i18next';
+
+import type { ProviderModelItem, ModelListItem, DescriptionItem, BaseRef } from './types'
+import RbCard from '@/components/RbCard/Card'
+import { getModelNewList } from '@/api/models'
+import PageEmpty from '@/components/Empty/PageEmpty';
+import { formatDateTime } from '@/utils/format';
+
+const Group = forwardRef void; }>(({ query, handleEdit }, ref) => {
+ const { t } = useTranslation();
+ const [list, setList] = useState([])
+ useEffect(() => {
+ getList()
+ }, [query])
+ const getList = () => {
+ getModelNewList({
+ ...query,
+ is_composite: true,
+ is_active: true,
+ })
+ .then(res => {
+ const response = res as ProviderModelItem[]
+ setList(response[0]?.models || [])
+ })
+ }
+ const formatData = (data: ModelListItem) => {
+ return [
+ {
+ key: 'type',
+ label: t(`modelNew.type`),
+ children: data.type || '-',
+ },
+ {
+ key: 'provider',
+ label: t(`modelNew.provider`),
+ children: data.provider || '-',
+ },
+ {
+ key: 'is_active',
+ label: t(`modelNew.status`),
+ children: data.is_active ? t(`common.statusEnabled`) : t(`common.statusDisabled`),
+ },
+ {
+ key: 'created_at',
+ label: t(`modelNew.created_at`),
+ children: data.created_at ? formatDateTime(data.created_at, 'YYYY-MM-DD HH:mm:ss') : '-',
+ },
+ ]
+ }
+
+ useImperativeHandle(ref, () => ({
+ getList,
+ }));
+
+ return (
+ <>
+ {list.length === 0
+ ?
+ :(
+
+ {list.map(item => (
+
+ {item.name[0]}
+
+ }
+ >
+ {formatData(item)?.map((description: DescriptionItem) => (
+
+ {(description.label as string)}
+ {(description.children as string)}
+
+ ))}
+
+
+ ))}
+
+ )
+ }
+ >
+ )
+})
+
+export default Group
\ No newline at end of file
diff --git a/web/src/views/ModelManagement/List.tsx b/web/src/views/ModelManagement/List.tsx
new file mode 100644
index 00000000..f1127623
--- /dev/null
+++ b/web/src/views/ModelManagement/List.tsx
@@ -0,0 +1,83 @@
+import { useRef, useState, useEffect, type FC } from 'react';
+import { Button, Space, Row, Col } from 'antd'
+import { useTranslation } from 'react-i18next';
+
+import type { ProviderModelItem, KeyConfigModalRef, ModelListDetailRef } from './types'
+import RbCard from '@/components/RbCard/Card'
+import { getModelNewList } from '@/api/models'
+import PageEmpty from '@/components/Empty/PageEmpty';
+import Tag from '@/components/Tag';
+import KeyConfigModal from './components/KeyConfigModal'
+import ModelListDetail from './components/ModelListDetail'
+
+const ModelList: FC<{ query: any }> = ({ query }) => {
+ const { t } = useTranslation();
+ const keyConfigModalRef = useRef
(null)
+ const modelListDetailRef = useRef(null)
+ const [list, setList] = useState([])
+ useEffect(() => {
+ getList()
+ }, [query])
+ const getList = () => {
+ getModelNewList({
+ ...query,
+ is_composite: false,
+ is_active: true,
+ })
+ .then(res => {
+ setList((res || []) as ProviderModelItem[])
+ })
+ }
+
+ const handleShowModel = (vo: ProviderModelItem) => {
+ modelListDetailRef.current?.handleOpen(vo)
+ }
+ const handleKeyConfig = (vo: ProviderModelItem) => {
+ keyConfigModalRef.current?.handleOpen(vo)
+ }
+
+ return (
+ <>
+ {list.length === 0
+ ?
+ :(
+
+ {list.map(item => (
+
+ {item.provider[0]}
+
+ }
+ >
+ {item.tags.map(tag => {t(`modelNew.${tag}`)})}
+
+
+
+
+
+
+
+
+
+ ))}
+
+ )
+ }
+
+