|
|
|
/*
|
|
|
|
* @Author: donghao donghao@supervision.ltd
|
|
|
|
* @Date: 2024-05-24 17:57:19
|
|
|
|
* @LastEditors: donghao donghao@supervision.ltd
|
|
|
|
* @LastEditTime: 2024-05-31 14:19:28
|
|
|
|
* @FilePath: \general-ai-platform-web\src\services\business\model.ts
|
|
|
|
* @Description: api 模型
|
|
|
|
*/
|
|
|
|
|
|
|
|
// @ts-ignore
|
|
|
|
/* eslint-disable */
|
|
|
|
import { request } from '@umijs/max';
|
|
|
|
|
|
|
|
/** 企业业务模型部署 */
|
|
|
|
// 添加企业部署的业务模型
|
|
|
|
export async function apiModelDeploymentAdd(body: any, options?: { [key: string]: any }) {
|
|
|
|
return request<API.Response & { data?: API.ENTITY_INDEX_DATA; msg?: string }>(
|
|
|
|
`/api/v1/model/deployment/add`,
|
|
|
|
{
|
|
|
|
method: 'POST',
|
|
|
|
headers: {
|
|
|
|
// 'Content-Type': 'application/json',
|
|
|
|
// "Content-Type": "application/x-www-form-urlencoded; charset=UTF-8"
|
|
|
|
},
|
|
|
|
data: body,
|
|
|
|
...(options || {}),
|
|
|
|
},
|
|
|
|
);
|
|
|
|
}
|
|
|
|
// 编辑企业部署的业务模型
|
|
|
|
export async function apiModelDeploymentEdit(body: any, options?: { [key: string]: any }) {
|
|
|
|
return request<API.Response & { data?: API.ENTITY_INDEX_DATA; msg?: string }>(
|
|
|
|
`/api/v1/model/deployment/edit`,
|
|
|
|
{
|
|
|
|
method: 'POST',
|
|
|
|
headers: {
|
|
|
|
// 'Content-Type': 'application/json',
|
|
|
|
// "Content-Type": "application/x-www-form-urlencoded; charset=UTF-8"
|
|
|
|
},
|
|
|
|
data: body,
|
|
|
|
...(options || {}),
|
|
|
|
},
|
|
|
|
);
|
|
|
|
}
|
|
|
|
// 企业部署的业务模型列表
|
|
|
|
export async function apiModelDeploymentList(body: any, options?: { [key: string]: any }) {
|
|
|
|
return request<API.Response & { data?: API.ENTITY_INDEX_DATA; msg?: string }>(
|
|
|
|
`/api/v1/model/deployment/list`,
|
|
|
|
{
|
|
|
|
method: 'POST',
|
|
|
|
headers: {
|
|
|
|
// 'Content-Type': 'application/json',
|
|
|
|
// "Content-Type": "application/x-www-form-urlencoded; charset=UTF-8"
|
|
|
|
},
|
|
|
|
data: body,
|
|
|
|
...(options || {}),
|
|
|
|
},
|
|
|
|
);
|
|
|
|
}
|
|
|
|
// // 删除企业部署的业务模型
|
|
|
|
// export async function apiModelDeploymentDelete(body: any, options?: { [key: string]: any }) {
|
|
|
|
// return request<API.Response & { data?: API.ENTITY_INDEX_DATA; msg?: string }>(
|
|
|
|
// `/api/v1/model/deployment/delete`,
|
|
|
|
// {
|
|
|
|
// method: 'POST',
|
|
|
|
// headers: {
|
|
|
|
// // 'Content-Type': 'application/json',
|
|
|
|
// // "Content-Type": "application/x-www-form-urlencoded; charset=UTF-8"
|
|
|
|
// },
|
|
|
|
// data: body,
|
|
|
|
// ...(options || {}),
|
|
|
|
// },
|
|
|
|
// );
|
|
|
|
// }
|
|
|
|
|
|
|
|
// 企业部署的业务模型信息
|
|
|
|
export async function apiModelDeploymentInfo(body: any, options?: { [key: string]: any }) {
|
|
|
|
return request<API.Response & { data?: API.ENTITY_INDEX_DATA; msg?: string }>(
|
|
|
|
`/api/v1/model/deployment/info`,
|
|
|
|
{
|
|
|
|
method: 'POST',
|
|
|
|
headers: {
|
|
|
|
// 'Content-Type': 'application/json',
|
|
|
|
// "Content-Type": "application/x-www-form-urlencoded; charset=UTF-8"
|
|
|
|
},
|
|
|
|
data: body,
|
|
|
|
...(options || {}),
|
|
|
|
},
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
/** 基础模型管理 */
|
|
|
|
// 添加模型分类
|
|
|
|
export async function apiModelClassificationAdd(body: any, options?: { [key: string]: any }) {
|
|
|
|
return request<API.Response & { data?: API.ENTITY_INDEX_DATA; msg?: string }>(
|
|
|
|
`/api/v1/model/classification/add`,
|
|
|
|
{
|
|
|
|
method: 'POST',
|
|
|
|
headers: {
|
|
|
|
// 'Content-Type': 'application/json',
|
|
|
|
// "Content-Type": "application/x-www-form-urlencoded; charset=UTF-8"
|
|
|
|
},
|
|
|
|
data: body,
|
|
|
|
...(options || {}),
|
|
|
|
},
|
|
|
|
);
|
|
|
|
}
|
|
|
|
// 模型分类列表
|
|
|
|
export async function apiModelClassificationList(body: any, options?: { [key: string]: any }) {
|
|
|
|
return request<API.Response & { data?: API.ENTITY_INDEX_DATA; msg?: string }>(
|
|
|
|
`/api/v1/model/classification/list`,
|
|
|
|
{
|
|
|
|
method: 'POST',
|
|
|
|
headers: {
|
|
|
|
// 'Content-Type': 'application/json',
|
|
|
|
// "Content-Type": "application/x-www-form-urlencoded; charset=UTF-8"
|
|
|
|
},
|
|
|
|
data: body,
|
|
|
|
...(options || {}),
|
|
|
|
},
|
|
|
|
);
|
|
|
|
}
|
|
|
|
// 删除模型分类
|
|
|
|
export async function apiModelClassificationDelete(body: any, options?: { [key: string]: any }) {
|
|
|
|
return request<API.Response & { data?: API.ENTITY_INDEX_DATA; msg?: string }>(
|
|
|
|
`/api/v1/model/classification/delete`,
|
|
|
|
{
|
|
|
|
method: 'POST',
|
|
|
|
headers: {
|
|
|
|
// 'Content-Type': 'application/json',
|
|
|
|
// "Content-Type": "application/x-www-form-urlencoded; charset=UTF-8"
|
|
|
|
},
|
|
|
|
data: body,
|
|
|
|
...(options || {}),
|
|
|
|
},
|
|
|
|
);
|
|
|
|
}
|
|
|
|
// 添加模型
|
|
|
|
export async function apiModelAdd(body: any, options?: { [key: string]: any }) {
|
|
|
|
return request<API.Response & { data?: API.ENTITY_INDEX_DATA; msg?: string }>(
|
|
|
|
`/api/v1/model/add`,
|
|
|
|
{
|
|
|
|
method: 'POST',
|
|
|
|
headers: {
|
|
|
|
// 'Content-Type': 'application/json',
|
|
|
|
// "Content-Type": "application/x-www-form-urlencoded; charset=UTF-8"
|
|
|
|
},
|
|
|
|
data: body,
|
|
|
|
...(options || {}),
|
|
|
|
},
|
|
|
|
);
|
|
|
|
}
|
|
|
|
// 模型列表
|
|
|
|
export async function apiModelList(body: any, options?: { [key: string]: any }) {
|
|
|
|
return request<API.Response & { data?: API.ENTITY_INDEX_DATA; msg?: string }>(
|
|
|
|
`/api/v1/model/list`,
|
|
|
|
{
|
|
|
|
method: 'POST',
|
|
|
|
headers: {
|
|
|
|
// 'Content-Type': 'application/json',
|
|
|
|
// "Content-Type": "application/x-www-form-urlencoded; charset=UTF-8"
|
|
|
|
},
|
|
|
|
data: body,
|
|
|
|
...(options || {}),
|
|
|
|
},
|
|
|
|
);
|
|
|
|
}
|
|
|
|
// 删除模型
|
|
|
|
export async function apiModelDelete(body: any, options?: { [key: string]: any }) {
|
|
|
|
return request<API.Response & { data?: API.ENTITY_INDEX_DATA; msg?: string }>(
|
|
|
|
`/api/v1/model/delete`,
|
|
|
|
{
|
|
|
|
method: 'POST',
|
|
|
|
headers: {
|
|
|
|
// 'Content-Type': 'application/json',
|
|
|
|
// "Content-Type": "application/x-www-form-urlencoded; charset=UTF-8"
|
|
|
|
},
|
|
|
|
data: body,
|
|
|
|
...(options || {}),
|
|
|
|
},
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
// 编辑模型
|
|
|
|
export async function apiModelEdit(body: any, options?: { [key: string]: any }) {
|
|
|
|
return request<API.Response & { data?: API.ENTITY_INDEX_DATA; msg?: string }>(
|
|
|
|
`/api/v1/model/edit`,
|
|
|
|
{
|
|
|
|
method: 'POST',
|
|
|
|
headers: {
|
|
|
|
// 'Content-Type': 'application/json',
|
|
|
|
// "Content-Type": "application/x-www-form-urlencoded; charset=UTF-8"
|
|
|
|
},
|
|
|
|
data: body,
|
|
|
|
...(options || {}),
|
|
|
|
},
|
|
|
|
);
|
|
|
|
}
|
|
|
|
// 模型信息
|
|
|
|
export async function apiModelInfo(body: any, options?: { [key: string]: any }) {
|
|
|
|
return request<API.Response & { data?: API.ENTITY_INDEX_DATA; msg?: string }>(
|
|
|
|
`/api/v1/model/info`,
|
|
|
|
{
|
|
|
|
method: 'POST',
|
|
|
|
headers: {
|
|
|
|
// 'Content-Type': 'application/json',
|
|
|
|
// "Content-Type": "application/x-www-form-urlencoded; charset=UTF-8"
|
|
|
|
},
|
|
|
|
data: body,
|
|
|
|
...(options || {}),
|
|
|
|
},
|
|
|
|
);
|
|
|
|
}
|
|
|
|
/** 模型版本 */
|
|
|
|
// 添加模型版本
|
|
|
|
export async function apiModelVersionAdd(body: any, options?: { [key: string]: any }) {
|
|
|
|
return request<API.Response & { data?: API.ENTITY_INDEX_DATA; msg?: string }>(
|
|
|
|
`/api/v1/model/version/add`,
|
|
|
|
{
|
|
|
|
method: 'POST',
|
|
|
|
headers: {
|
|
|
|
// 'Content-Type': 'application/json',
|
|
|
|
// "Content-Type": "application/x-www-form-urlencoded; charset=UTF-8"
|
|
|
|
},
|
|
|
|
data: body,
|
|
|
|
...(options || {}),
|
|
|
|
},
|
|
|
|
);
|
|
|
|
}
|
|
|
|
// 编辑模型版本
|
|
|
|
export async function apiModelVersionEdit(body: any, options?: { [key: string]: any }) {
|
|
|
|
return request<API.Response & { data?: API.ENTITY_INDEX_DATA; msg?: string }>(
|
|
|
|
`/api/v1/model/version/edit`,
|
|
|
|
{
|
|
|
|
method: 'POST',
|
|
|
|
headers: {
|
|
|
|
// 'Content-Type': 'application/json',
|
|
|
|
// "Content-Type": "application/x-www-form-urlencoded; charset=UTF-8"
|
|
|
|
},
|
|
|
|
data: body,
|
|
|
|
...(options || {}),
|
|
|
|
},
|
|
|
|
);
|
|
|
|
}
|
|
|
|
// 模型版本列表
|
|
|
|
export async function apiModelVersionList(body: any, options?: { [key: string]: any }) {
|
|
|
|
return request<API.Response & { data?: API.ENTITY_INDEX_DATA; msg?: string }>(
|
|
|
|
`/api/v1/model/version/list`,
|
|
|
|
{
|
|
|
|
method: 'POST',
|
|
|
|
headers: {
|
|
|
|
// 'Content-Type': 'application/json',
|
|
|
|
// "Content-Type": "application/x-www-form-urlencoded; charset=UTF-8"
|
|
|
|
},
|
|
|
|
data: body,
|
|
|
|
...(options || {}),
|
|
|
|
},
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
// 模型版本信息
|
|
|
|
export async function apiModelVersionInfo(body: any, options?: { [key: string]: any }) {
|
|
|
|
return request<API.Response & { data?: API.ENTITY_INDEX_DATA; msg?: string }>(
|
|
|
|
`/api/v1/model/version/info`,
|
|
|
|
{
|
|
|
|
method: 'POST',
|
|
|
|
headers: {
|
|
|
|
// 'Content-Type': 'application/json',
|
|
|
|
// "Content-Type": "application/x-www-form-urlencoded; charset=UTF-8"
|
|
|
|
},
|
|
|
|
data: body,
|
|
|
|
...(options || {}),
|
|
|
|
},
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
// 设置模型默认版本
|
|
|
|
export async function apiModelVersionSetdefault(body: any, options?: { [key: string]: any }) {
|
|
|
|
return request<API.Response & { data?: API.ENTITY_INDEX_DATA; msg?: string }>(
|
|
|
|
`/api/v1/model/version/setdefault`,
|
|
|
|
{
|
|
|
|
method: 'POST',
|
|
|
|
headers: {
|
|
|
|
// 'Content-Type': 'application/json',
|
|
|
|
// "Content-Type": "application/x-www-form-urlencoded; charset=UTF-8"
|
|
|
|
},
|
|
|
|
data: body,
|
|
|
|
...(options || {}),
|
|
|
|
},
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
// 删除模型版本
|
|
|
|
export async function apiModelVersionDelete(body: any, options?: { [key: string]: any }) {
|
|
|
|
return request<API.Response & { data?: API.ENTITY_INDEX_DATA; msg?: string }>(
|
|
|
|
`/api/v1/model/version/delete`,
|
|
|
|
{
|
|
|
|
method: 'POST',
|
|
|
|
headers: {
|
|
|
|
// 'Content-Type': 'application/json',
|
|
|
|
// "Content-Type": "application/x-www-form-urlencoded; charset=UTF-8"
|
|
|
|
},
|
|
|
|
data: body,
|
|
|
|
...(options || {}),
|
|
|
|
},
|
|
|
|
);
|
|
|
|
}
|
|
|
|
/** 模型运行库 */
|
|
|
|
// 查询docker registry中的镜像
|
|
|
|
export async function apiModelHubSync(body: any, options?: { [key: string]: any }) {
|
|
|
|
return request<API.Response & { data?: API.ENTITY_INDEX_DATA; msg?: string }>(
|
|
|
|
`/api/v1/model/hub/sync`,
|
|
|
|
{
|
|
|
|
method: 'POST',
|
|
|
|
headers: {
|
|
|
|
// 'Content-Type': 'application/json',
|
|
|
|
// "Content-Type": "application/x-www-form-urlencoded; charset=UTF-8"
|
|
|
|
},
|
|
|
|
data: body,
|
|
|
|
...(options || {}),
|
|
|
|
},
|
|
|
|
);
|
|
|
|
}
|
|
|
|
// 添加模型运行库
|
|
|
|
export async function apiModelHubAdd(body: any, options?: { [key: string]: any }) {
|
|
|
|
return request<API.Response & { data?: API.ENTITY_INDEX_DATA; msg?: string }>(
|
|
|
|
`/api/v1/model/hub/add`,
|
|
|
|
{
|
|
|
|
method: 'POST',
|
|
|
|
headers: {
|
|
|
|
// 'Content-Type': 'application/json',
|
|
|
|
// "Content-Type": "application/x-www-form-urlencoded; charset=UTF-8"
|
|
|
|
},
|
|
|
|
data: body,
|
|
|
|
...(options || {}),
|
|
|
|
},
|
|
|
|
);
|
|
|
|
}
|
|
|
|
// 编辑模型运行库
|
|
|
|
export async function apiModelHubEdit(body: any, options?: { [key: string]: any }) {
|
|
|
|
return request<API.Response & { data?: API.ENTITY_INDEX_DATA; msg?: string }>(
|
|
|
|
`/api/v1/model/hub/edit`,
|
|
|
|
{
|
|
|
|
method: 'POST',
|
|
|
|
headers: {
|
|
|
|
// 'Content-Type': 'application/json',
|
|
|
|
// "Content-Type": "application/x-www-form-urlencoded; charset=UTF-8"
|
|
|
|
},
|
|
|
|
data: body,
|
|
|
|
...(options || {}),
|
|
|
|
},
|
|
|
|
);
|
|
|
|
}
|
|
|
|
// 模型运行库列表
|
|
|
|
export async function apiModelHubList(body: any, options?: { [key: string]: any }) {
|
|
|
|
return request<API.Response & { data?: API.ENTITY_INDEX_DATA; msg?: string }>(
|
|
|
|
`/api/v1/model/hub/list`,
|
|
|
|
{
|
|
|
|
method: 'POST',
|
|
|
|
headers: {
|
|
|
|
// 'Content-Type': 'application/json',
|
|
|
|
// "Content-Type": "application/x-www-form-urlencoded; charset=UTF-8"
|
|
|
|
},
|
|
|
|
data: body,
|
|
|
|
...(options || {}),
|
|
|
|
},
|
|
|
|
);
|
|
|
|
}
|
|
|
|
// 删除模型运行库
|
|
|
|
export async function apiModelHubDelete(body: any, options?: { [key: string]: any }) {
|
|
|
|
return request<API.Response & { data?: API.ENTITY_INDEX_DATA; msg?: string }>(
|
|
|
|
`/api/v1/model/hub/delete`,
|
|
|
|
{
|
|
|
|
method: 'POST',
|
|
|
|
headers: {
|
|
|
|
// 'Content-Type': 'application/json',
|
|
|
|
// "Content-Type": "application/x-www-form-urlencoded; charset=UTF-8"
|
|
|
|
},
|
|
|
|
data: body,
|
|
|
|
...(options || {}),
|
|
|
|
},
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
// 模型运行库信息
|
|
|
|
export async function apiModelHubInfo(body: any, options?: { [key: string]: any }) {
|
|
|
|
return request<API.Response & { data?: API.ENTITY_INDEX_DATA; msg?: string }>(
|
|
|
|
`/api/v1/model/hub/info`,
|
|
|
|
{
|
|
|
|
method: 'POST',
|
|
|
|
headers: {
|
|
|
|
// 'Content-Type': 'application/json',
|
|
|
|
// "Content-Type": "application/x-www-form-urlencoded; charset=UTF-8"
|
|
|
|
},
|
|
|
|
data: body,
|
|
|
|
...(options || {}),
|
|
|
|
},
|
|
|
|
);
|
|
|
|
}
|