fix(web): knowledge base model api params

This commit is contained in:
zhaoying
2026-04-02 10:22:21 +08:00
parent fe29141437
commit 1305a08c86
2 changed files with 2 additions and 2 deletions

View File

@@ -68,7 +68,7 @@ export const getModelTypeList = async () => {
return response as any[];
};
// 获取模型列表
export const getModelList = async (types: string[], pageInfo: PageRequest) => {
export const getModelList = async (pageInfo: PageRequest, types?: string[]) => {
const response = await request.get(`${apiPrefix}/models`, { ...pageInfo, type: types?.join(','), is_active: true });
return response as any;
};

View File

@@ -207,7 +207,7 @@ const KnowledgeBaseManagement: FC = () => {
};
const fetchModelList = async () => {
try {
const response = await getModelList(['llm', 'embedding', 'rerank', 'chat'], { page: 1, pagesize: 100 });
const response = await getModelList({ page: 1, pagesize: 100 }, ['llm', 'embedding', 'rerank', 'chat']);
// 缓存模型列表,建立 id -> name 的映射
if (response?.items && Array.isArray(response.items)) {
const cache: Record<string, string> = {};