feat(admin): 渠道模型 - 拉取模型支持勾选导入并允许离线启停渠道
This commit is contained in:
@@ -269,9 +269,13 @@ export function listAdminChannelModels(channelId: string) {
|
||||
return request<{ models: ChannelModel[] }>(api.get(`/admin/channels/${encodeURIComponent(channelId)}/models`));
|
||||
}
|
||||
|
||||
// 管理员从上游拉取模型目录;服务端只导入缺失项,价格和启用仍需人工确认。
|
||||
// 管理员从上游读取模型目录;确认导入后才会写入渠道模型,价格和启用仍需人工确认。
|
||||
export function fetchAdminChannelModels(channelId: string) {
|
||||
return request<{ models: string[]; added: number }>(api.post(`/admin/channels/${encodeURIComponent(channelId)}/models/fetch`));
|
||||
return request<{ models: string[] }>(api.post(`/admin/channels/${encodeURIComponent(channelId)}/models/fetch`));
|
||||
}
|
||||
|
||||
export function importAdminChannelModels(channelId: string, models: string[]) {
|
||||
return request<{ models: string[]; added: number }>(api.post(`/admin/channels/${encodeURIComponent(channelId)}/models/import`, { models }));
|
||||
}
|
||||
|
||||
export function testAdminChannelModel(channelId: string, input: Pick<ChannelModel, "modelKey" | "providerModelKey" | "capability" | "protocol"> & { capabilityConfig?: ChannelModel["capabilityConfig"] }) {
|
||||
|
||||
Reference in New Issue
Block a user