feat(group): 支持自定义 /v1/models 模型列表

This commit is contained in:
lyen1688
2026-05-27 18:00:45 +08:00
committed by lyen1688
parent a391635191
commit f597c1581b
36 changed files with 1522 additions and 21 deletions
+18
View File
@@ -76,6 +76,23 @@ export async function getById(id: number): Promise<AdminGroup> {
return data
}
/**
* Get candidate models for custom /v1/models list.
* id=0 returns platform default models for create flow.
*/
export async function getModelsListCandidates(
id: number,
platform?: GroupPlatform
): Promise<string[]> {
const { data } = await apiClient.get<{ models: string[] }>(
`/admin/groups/${id}/models-list-candidates`,
{
params: platform ? { platform } : undefined
}
)
return data.models || []
}
/**
* Create new group
* @param groupData - Group data
@@ -306,6 +323,7 @@ export const groupsAPI = {
getAll,
getByPlatform,
getById,
getModelsListCandidates,
create,
update,
delete: deleteGroup,