fix(web): knowledge base model api params
This commit is contained in:
@@ -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;
|
||||
};
|
||||
|
||||
@@ -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> = {};
|
||||
|
||||
Reference in New Issue
Block a user