v2模型管理相关
This commit is contained in:
@@ -1,5 +1,28 @@
|
||||
import request from '/@/utils/request';
|
||||
|
||||
/** Token 映射 */
|
||||
export interface TokenMapping {
|
||||
promptTokens: string;
|
||||
completionTokens: string;
|
||||
totalTokens: string;
|
||||
}
|
||||
|
||||
/** 异步任务映射 */
|
||||
export interface AsyncTaskMapping {
|
||||
url: string;
|
||||
httpMethod: string;
|
||||
requestHeadMapping: Record<string, unknown>;
|
||||
responseMapping: Record<string, unknown>;
|
||||
taskId: string;
|
||||
taskStatus: string;
|
||||
taskStatusPending: string;
|
||||
taskStatusRunning: string;
|
||||
taskStatusSuccess: string;
|
||||
taskStatusFailed: string;
|
||||
taskStatusCancel: string;
|
||||
taskStatusUnknown: string;
|
||||
}
|
||||
|
||||
/** 列表查询参数 */
|
||||
export interface ListModelManageParams {
|
||||
pageNum: number;
|
||||
@@ -21,16 +44,25 @@ export interface ModelManageItem {
|
||||
modelName: string;
|
||||
modelType: number;
|
||||
baseUrl: string;
|
||||
systemModel: boolean;
|
||||
httpMethod: string;
|
||||
PrivateModel: boolean;
|
||||
ChatModel: boolean;
|
||||
invokeType: number;
|
||||
responseType: number;
|
||||
apiKey: string;
|
||||
enabled: boolean;
|
||||
requestMapping: Record<string, unknown>;
|
||||
responseMapping: Record<string, unknown>;
|
||||
ChatModel: boolean;
|
||||
maxConcurrency: number;
|
||||
maxTokens: number;
|
||||
tokenPredictPrice: number;
|
||||
requestHeadMapping: Record<string, unknown>;
|
||||
requestBodyMapping: Record<string, unknown>;
|
||||
responseMapping: Record<string, unknown>;
|
||||
tokenMapping?: TokenMapping;
|
||||
asyncTaskMapping?: AsyncTaskMapping;
|
||||
lastFrame?: string;
|
||||
// 以下旧字段兼容
|
||||
httpMethod?: string;
|
||||
systemModel?: boolean;
|
||||
PrivateModel?: boolean;
|
||||
invokeType?: number;
|
||||
requestMapping?: Record<string, unknown>;
|
||||
}
|
||||
|
||||
/** 列表响应 */
|
||||
@@ -59,6 +91,21 @@ export interface ModelManageTypeResponse {
|
||||
};
|
||||
}
|
||||
|
||||
/** 供应商列表项 */
|
||||
export interface ModelSupplierItem {
|
||||
value: number;
|
||||
label: string;
|
||||
}
|
||||
|
||||
/** 供应商列表响应 */
|
||||
export interface ModelSupplierListResponse {
|
||||
code: number;
|
||||
message: string;
|
||||
data: {
|
||||
list: ModelSupplierItem[];
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取模型配置列表(v2)
|
||||
*/
|
||||
@@ -91,21 +138,6 @@ export function deleteModelManage(id: string) {
|
||||
});
|
||||
}
|
||||
|
||||
/** 供应商列表项 */
|
||||
export interface ModelSupplierItem {
|
||||
value: number;
|
||||
label: string;
|
||||
}
|
||||
|
||||
/** 供应商列表响应 */
|
||||
export interface ModelSupplierListResponse {
|
||||
code: number;
|
||||
message: string;
|
||||
data: {
|
||||
list: ModelSupplierItem[];
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取模型供应商列表
|
||||
*/
|
||||
@@ -122,16 +154,19 @@ export interface CreateModelManageParams {
|
||||
modelName: string;
|
||||
modelType: number;
|
||||
baseUrl: string;
|
||||
httpMethod: string;
|
||||
systemModel?: boolean;
|
||||
privateModel?: boolean;
|
||||
responseType: number;
|
||||
apiKey?: string;
|
||||
enabled?: boolean;
|
||||
chatModel?: boolean;
|
||||
invokeType?: number;
|
||||
apiKey?: string;
|
||||
requestMapping?: Record<string, unknown>;
|
||||
responseMapping?: Record<string, unknown>;
|
||||
maxConcurrency?: number;
|
||||
maxTokens?: number;
|
||||
tokenPredictPrice?: number;
|
||||
requestHeadMapping?: Record<string, unknown>;
|
||||
requestBodyMapping?: Record<string, unknown>;
|
||||
responseMapping?: Record<string, unknown>;
|
||||
tokenMapping?: TokenMapping;
|
||||
asyncTaskMapping?: AsyncTaskMapping;
|
||||
lastFrame?: string;
|
||||
}
|
||||
|
||||
/** 更新模型配置参数 */
|
||||
|
||||
Reference in New Issue
Block a user