feat(web): getModelListUrl add is_active param
This commit is contained in:
@@ -65,7 +65,7 @@ export const getModelTypeList = async () => {
|
|||||||
};
|
};
|
||||||
// 获取模型列表
|
// 获取模型列表
|
||||||
export const getModelList = async (pageInfo: PageRequest) => {
|
export const getModelList = async (pageInfo: PageRequest) => {
|
||||||
const response = await request.get(`${apiPrefix}/models`, pageInfo);
|
const response = await request.get(`${apiPrefix}/models`, { ...pageInfo, is_active: true });
|
||||||
return response as any;
|
return response as any;
|
||||||
};
|
};
|
||||||
//获取模型提供者
|
//获取模型提供者
|
||||||
|
|||||||
@@ -237,7 +237,7 @@ const Agent = forwardRef<AgentRef>((_props, ref) => {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
const getModels = () => {
|
const getModels = () => {
|
||||||
getModelList({ type: 'llm,chat', pagesize: 100, page: 1 })
|
getModelList({ type: 'llm,chat', pagesize: 100, page: 1, is_active: true })
|
||||||
.then(res => {
|
.then(res => {
|
||||||
const response = res as { items: Model[] }
|
const response = res as { items: Model[] }
|
||||||
setModelList(response.items)
|
setModelList(response.items)
|
||||||
|
|||||||
@@ -225,7 +225,7 @@ const Cluster = forwardRef<ClusterRef>((_props, ref) => {
|
|||||||
<Form.Item name="default_model_config_id" noStyle>
|
<Form.Item name="default_model_config_id" noStyle>
|
||||||
<CustomSelect
|
<CustomSelect
|
||||||
url={getModelListUrl}
|
url={getModelListUrl}
|
||||||
params={{ type: 'llm,chat', pagesize: 100 }}
|
params={{ type: 'llm,chat', pagesize: 100, is_active: true }}
|
||||||
valueKey="id"
|
valueKey="id"
|
||||||
labelKey="name"
|
labelKey="name"
|
||||||
hasAll={false}
|
hasAll={false}
|
||||||
|
|||||||
@@ -181,7 +181,7 @@ const AiPromptModal = forwardRef<AiPromptModalRef, AiPromptModalProps>(({
|
|||||||
>
|
>
|
||||||
<CustomSelect
|
<CustomSelect
|
||||||
url={getModelListUrl}
|
url={getModelListUrl}
|
||||||
params={{ type: 'llm,chat', pagesize: 100 }}
|
params={{ type: 'llm,chat', pagesize: 100, is_active: true }}
|
||||||
valueKey="id"
|
valueKey="id"
|
||||||
labelKey="name"
|
labelKey="name"
|
||||||
hasAll={false}
|
hasAll={false}
|
||||||
|
|||||||
@@ -97,7 +97,7 @@ const KnowledgeGlobalConfigModal = forwardRef<KnowledgeGlobalConfigModalRef, Kno
|
|||||||
>
|
>
|
||||||
<CustomSelect
|
<CustomSelect
|
||||||
url={getModelListUrl}
|
url={getModelListUrl}
|
||||||
params={{ type: 'rerank', pagesize: 100 }}
|
params={{ type: 'rerank', pagesize: 100, is_active: true }}
|
||||||
valueKey="id"
|
valueKey="id"
|
||||||
labelKey="name"
|
labelKey="name"
|
||||||
hasAll={false}
|
hasAll={false}
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ const configList = [
|
|||||||
key: 'emotion_model_id',
|
key: 'emotion_model_id',
|
||||||
type: 'customSelect',
|
type: 'customSelect',
|
||||||
url: getModelListUrl,
|
url: getModelListUrl,
|
||||||
params: { type: 'chat,llm', page: 1, pagesize: 100 }, // chat,llm
|
params: { type: 'chat,llm', page: 1, pagesize: 100, is_active: true }, // chat,llm
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: 'emotion_min_intensity',
|
key: 'emotion_min_intensity',
|
||||||
|
|||||||
@@ -1,14 +1,14 @@
|
|||||||
import { type FC, useState, useEffect } from 'react'
|
import { type FC, useState, useEffect } from 'react'
|
||||||
import { useTranslation } from 'react-i18next'
|
import { useTranslation } from 'react-i18next'
|
||||||
import { useParams } from 'react-router-dom'
|
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 clsx from 'clsx'
|
||||||
import Card from './components/Card'
|
import Card from './components/Card'
|
||||||
import type { ConfigForm, Variable } from './types'
|
import type { ConfigForm, Variable } from './types'
|
||||||
import { getMemoryExtractionConfig, updateMemoryExtractionConfig } from '@/api/memory'
|
import { getMemoryExtractionConfig, updateMemoryExtractionConfig } from '@/api/memory'
|
||||||
import Markdown from '@/components/Markdown'
|
import Markdown from '@/components/Markdown'
|
||||||
import { getModelList } from '@/api/models';
|
import { getModelList } from '@/api/models';
|
||||||
import type { Model } from '@/views/ModelManagement/types'
|
import type { ModelListItem } from '@/views/ModelManagement/types'
|
||||||
import { configList } from './constant'
|
import { configList } from './constant'
|
||||||
import Result from './components/Result'
|
import Result from './components/Result'
|
||||||
import SwitchFormItem from '@/components/FormItem/SwitchFormItem'
|
import SwitchFormItem from '@/components/FormItem/SwitchFormItem'
|
||||||
@@ -43,7 +43,7 @@ const MemoryExtractionEngine: FC = () => {
|
|||||||
const values = Form.useWatch<ConfigForm>([], form)
|
const values = Form.useWatch<ConfigForm>([], form)
|
||||||
const [loading, setLoading] = useState(false)
|
const [loading, setLoading] = useState(false)
|
||||||
const [iterationPeriodDisabled, setIterationPeriodDisabled] = useState(false)
|
const [iterationPeriodDisabled, setIterationPeriodDisabled] = useState(false)
|
||||||
const [modelList, setModelList] = useState<Model[]>([])
|
const [modelList, setModelList] = useState<ModelListItem[]>([])
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (values?.reflexion_range === 'database') {
|
if (values?.reflexion_range === 'database') {
|
||||||
@@ -55,9 +55,9 @@ const MemoryExtractionEngine: FC = () => {
|
|||||||
}, [values])
|
}, [values])
|
||||||
|
|
||||||
const getModels = () => {
|
const getModels = () => {
|
||||||
getModelList({ type: 'llm,chat', pagesize: 100, page: 1 })
|
getModelList({ type: 'llm,chat', pagesize: 100, page: 1, is_active: true })
|
||||||
.then(res => {
|
.then(res => {
|
||||||
const response = res as { items: Model[] }
|
const response = res as { items: ModelListItem[] }
|
||||||
setModelList(response.items)
|
setModelList(response.items)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,6 +5,9 @@ export interface Query {
|
|||||||
is_public?: boolean;
|
is_public?: boolean;
|
||||||
is_composite?: boolean;
|
is_composite?: boolean;
|
||||||
search?: string;
|
search?: string;
|
||||||
|
|
||||||
|
pagesize?: number;
|
||||||
|
page?: number;
|
||||||
}
|
}
|
||||||
export interface DescriptionItem {
|
export interface DescriptionItem {
|
||||||
key: string;
|
key: string;
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ const configList = [
|
|||||||
key: 'reflection_model_id',
|
key: 'reflection_model_id',
|
||||||
type: 'customSelect',
|
type: 'customSelect',
|
||||||
url: getModelListUrl,
|
url: getModelListUrl,
|
||||||
params: { type: 'chat,llm', page: 1, pagesize: 100 }, // chat,llm
|
params: { type: 'chat,llm', page: 1, pagesize: 100, is_active: true }, // chat,llm
|
||||||
},
|
},
|
||||||
// 迭代周期
|
// 迭代周期
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -66,7 +66,7 @@ const SpaceConfig: FC = () => {
|
|||||||
>
|
>
|
||||||
<CustomSelect
|
<CustomSelect
|
||||||
url={getModelListUrl}
|
url={getModelListUrl}
|
||||||
params={{ type: 'llm', pagesize: 100 }}
|
params={{ type: 'llm', pagesize: 100, is_active: true }}
|
||||||
valueKey="id"
|
valueKey="id"
|
||||||
labelKey="name"
|
labelKey="name"
|
||||||
hasAll={false}
|
hasAll={false}
|
||||||
@@ -80,7 +80,7 @@ const SpaceConfig: FC = () => {
|
|||||||
>
|
>
|
||||||
<CustomSelect
|
<CustomSelect
|
||||||
url={getModelListUrl}
|
url={getModelListUrl}
|
||||||
params={{ type: 'embedding', pagesize: 100 }}
|
params={{ type: 'embedding', pagesize: 100, is_active: true }}
|
||||||
valueKey="id"
|
valueKey="id"
|
||||||
labelKey="name"
|
labelKey="name"
|
||||||
hasAll={false}
|
hasAll={false}
|
||||||
@@ -94,7 +94,7 @@ const SpaceConfig: FC = () => {
|
|||||||
>
|
>
|
||||||
<CustomSelect
|
<CustomSelect
|
||||||
url={getModelListUrl}
|
url={getModelListUrl}
|
||||||
params={{ type: 'rerank', pagesize: 100 }}
|
params={{ type: 'rerank', pagesize: 100, is_active: true }}
|
||||||
valueKey="id"
|
valueKey="id"
|
||||||
labelKey="name"
|
labelKey="name"
|
||||||
hasAll={false}
|
hasAll={false}
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ import { createWorkspace } from '@/api/workspaces'
|
|||||||
import RadioGroupCard from '@/components/RadioGroupCard'
|
import RadioGroupCard from '@/components/RadioGroupCard'
|
||||||
import { getModelListUrl, getModelList } from '@/api/models'
|
import { getModelListUrl, getModelList } from '@/api/models'
|
||||||
import CustomSelect from '@/components/CustomSelect'
|
import CustomSelect from '@/components/CustomSelect'
|
||||||
import type { Model } from '@/views/ModelManagement/types'
|
import type { ModelListItem } from '@/views/ModelManagement/types'
|
||||||
|
|
||||||
const FormItem = Form.Item;
|
const FormItem = Form.Item;
|
||||||
|
|
||||||
@@ -29,7 +29,7 @@ const SpaceModal = forwardRef<SpaceModalRef, SpaceModalProps>(({
|
|||||||
const [form] = Form.useForm<SpaceModalData>();
|
const [form] = Form.useForm<SpaceModalData>();
|
||||||
const [loading, setLoading] = useState(false)
|
const [loading, setLoading] = useState(false)
|
||||||
const [editVo, setEditVo] = useState<Space | null>(null)
|
const [editVo, setEditVo] = useState<Space | null>(null)
|
||||||
const [modelList, setModelList] = useState<Model[]>([])
|
const [modelList, setModelList] = useState<ModelListItem[]>([])
|
||||||
|
|
||||||
const values = Form.useWatch([], form);
|
const values = Form.useWatch([], form);
|
||||||
|
|
||||||
@@ -80,9 +80,9 @@ const SpaceModal = forwardRef<SpaceModalRef, SpaceModalProps>(({
|
|||||||
}, [])
|
}, [])
|
||||||
|
|
||||||
const getModels = () => {
|
const getModels = () => {
|
||||||
getModelList({ type: 'llm,chat', pagesize: 100, page: 1 })
|
getModelList({ type: 'llm,chat', pagesize: 100, page: 1, is_active: true })
|
||||||
.then(res => {
|
.then(res => {
|
||||||
const response = res as { items: Model[] }
|
const response = res as { items: ModelListItem[] }
|
||||||
setModelList(response.items)
|
setModelList(response.items)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@@ -134,7 +134,7 @@ const SpaceModal = forwardRef<SpaceModalRef, SpaceModalProps>(({
|
|||||||
>
|
>
|
||||||
<CustomSelect
|
<CustomSelect
|
||||||
url={getModelListUrl}
|
url={getModelListUrl}
|
||||||
params={{ type: 'embedding', pagesize: 100 }}
|
params={{ type: 'embedding', pagesize: 100, is_active: true }}
|
||||||
valueKey="id"
|
valueKey="id"
|
||||||
labelKey="name"
|
labelKey="name"
|
||||||
hasAll={false}
|
hasAll={false}
|
||||||
@@ -148,7 +148,7 @@ const SpaceModal = forwardRef<SpaceModalRef, SpaceModalProps>(({
|
|||||||
>
|
>
|
||||||
<CustomSelect
|
<CustomSelect
|
||||||
url={getModelListUrl}
|
url={getModelListUrl}
|
||||||
params={{ type: 'rerank', pagesize: 100 }}
|
params={{ type: 'rerank', pagesize: 100, is_active: true }}
|
||||||
valueKey="id"
|
valueKey="id"
|
||||||
labelKey="name"
|
labelKey="name"
|
||||||
hasAll={false}
|
hasAll={false}
|
||||||
|
|||||||
@@ -98,7 +98,7 @@ const KnowledgeGlobalConfigModal = forwardRef<KnowledgeGlobalConfigModalRef, Kno
|
|||||||
>
|
>
|
||||||
<CustomSelect
|
<CustomSelect
|
||||||
url={getModelListUrl}
|
url={getModelListUrl}
|
||||||
params={{ type: 'rerank', pagesize: 100 }}
|
params={{ type: 'rerank', pagesize: 100, is_active: true }}
|
||||||
valueKey="id"
|
valueKey="id"
|
||||||
labelKey="name"
|
labelKey="name"
|
||||||
hasAll={false}
|
hasAll={false}
|
||||||
|
|||||||
@@ -105,7 +105,7 @@ export const nodeLibrary: NodeLibrary[] = [
|
|||||||
model_id: {
|
model_id: {
|
||||||
type: 'customSelect',
|
type: 'customSelect',
|
||||||
url: getModelListUrl,
|
url: getModelListUrl,
|
||||||
params: { type: 'llm,chat' }, // llm/chat
|
params: { type: 'llm,chat', is_active: true }, // llm/chat
|
||||||
valueKey: 'id',
|
valueKey: 'id',
|
||||||
labelKey: 'name',
|
labelKey: 'name',
|
||||||
},
|
},
|
||||||
@@ -166,7 +166,7 @@ export const nodeLibrary: NodeLibrary[] = [
|
|||||||
model_id: {
|
model_id: {
|
||||||
type: 'customSelect',
|
type: 'customSelect',
|
||||||
url: getModelListUrl,
|
url: getModelListUrl,
|
||||||
params: { type: 'llm,chat' }, // llm/chat
|
params: { type: 'llm,chat', is_active: true }, // llm/chat
|
||||||
valueKey: 'id',
|
valueKey: 'id',
|
||||||
labelKey: 'name',
|
labelKey: 'name',
|
||||||
},
|
},
|
||||||
@@ -259,7 +259,7 @@ export const nodeLibrary: NodeLibrary[] = [
|
|||||||
model_id: {
|
model_id: {
|
||||||
type: 'customSelect',
|
type: 'customSelect',
|
||||||
url: getModelListUrl,
|
url: getModelListUrl,
|
||||||
params: { type: 'llm,chat' }, // llm/chat
|
params: { type: 'llm,chat', is_active: true }, // llm/chat
|
||||||
valueKey: 'id',
|
valueKey: 'id',
|
||||||
labelKey: 'name',
|
labelKey: 'name',
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user