import request from '/@/utils/request';

// 模型配置查询参数
export interface ModelConfigQueryParams {
	pageNum: number;
	pageSize: number;
	modelType?: string;
	modelName?: string;
}

// 模型配置信息
export interface ModelConfigInfo {
	id: number;
	modelType: string;
	modelName: string;
	modelDesc: string;
	configType: string;
	configContent: number[];
	createTime: string;
	updateTime: string;
}

// 获取模型配置列表
export function listModelConfigs(params?: ModelConfigQueryParams) {
	return request({
		url: '/rag/model/list',
		method: 'get',
		params,
	});
}

// 创建模型配置
export function createModelConfig(data: any) {
	return request({
		url: '/rag/model/create',
		method: 'post',
		data,
	});
}

// 更新模型配置
export function updateModelConfig(data: any) {
	return request({
		url: '/rag/model/update',
		method: 'put',
		data,
	});
}

// 删除模型配置
export function deleteModelConfig(id: string | number) {
	return request({
		url: '/rag/model/delete',
		method: 'post',
		data: { id },
	});
}

// 获取模型配置详情
export function getModelConfig(id: string | number, modelType: string) {
	return request({
		url: '/rag/model/get',
		method: 'get',
		params: { id, modelType },
	});
}

// 获取模型类型和配置类型枚举
export function getAllModelEnums() {
	return request({
		url: '/rag/model/getAllEnums',
		method: 'get',
	});
}

// 获取模型表单字段
export function getModelFormField(modelType: string, configType: string) {
	return request({
		url: '/rag/model/getModelFormField',
		method: 'get',
		params: { modelType, configType },
	});
}
