更新表结构,实体类
This commit is contained in:
parent
d3f8722f5a
commit
c77394fb8f
@ -22,10 +22,37 @@ public interface ErrorCodeConstants {
|
||||
ErrorCode MODEL_ASSESS_TASK_MANUAL_NOT_EXISTS = new ErrorCode(10009, "人工评估不存在");
|
||||
|
||||
ErrorCode MODEL_ASSESS_DIMENSION_NOT_EXISTS = new ErrorCode(10010, "评估维度不存在");
|
||||
|
||||
ErrorCode MODEL_ASSESS_TASK_DIMENSION_NOT_EXISTS = new ErrorCode(10011, "人工评估维度不存在");
|
||||
|
||||
ErrorCode MODEL_ASSESS_TASK_AUTO_NOT_EXISTS = new ErrorCode(10012, "自动评估维度不存在");
|
||||
|
||||
ErrorCode MODEL_ASSESS_TASK_STOPLIST_NOT_EXISTS = new ErrorCode(10013, "自动评估维度不存在");
|
||||
|
||||
ErrorCode MODEL_ASSESS_STOPLIST_NOT_EXISTS = new ErrorCode(10014, "自动评估维度不存在");
|
||||
|
||||
ErrorCode LEARNING_RESOURCES_NOT_EXISTS = new ErrorCode(10015, "学习资源不存在");
|
||||
|
||||
ErrorCode PROMPT_TEMPLATES_NOT_EXISTS = new ErrorCode(10016, "模板信息不存在");
|
||||
|
||||
ErrorCode PROMPT_TEMPLATES_APPLICATIONS_NOT_EXISTS = new ErrorCode(10017, "模板信息不存在");
|
||||
|
||||
ErrorCode PROMPT_TEMPLATES_TAGS_NOT_EXISTS = new ErrorCode(10017, "模板信息不存在");
|
||||
|
||||
ErrorCode FINE_TUNING_LOSS_NOT_EXISTS = new ErrorCode(10018, "损失记录不存在");
|
||||
|
||||
ErrorCode FINE_TUNING_NOT_EXISTS = new ErrorCode(10019, "模型微调不存在");
|
||||
|
||||
ErrorCode DATA_PROCESS_TASK_NOT_EXISTS = new ErrorCode(10020, "数据处理任务不存在");
|
||||
|
||||
ErrorCode CONVERSATION_NOT_EXISTS = new ErrorCode(10021, "大模型对话记录不存在");
|
||||
|
||||
ErrorCode BASE_MODEL_NOT_EXISTS = new ErrorCode(10022, "基座模型不存在");
|
||||
|
||||
ErrorCode DATASET_ANSWER_NOT_EXISTS = new ErrorCode(10023, "数据集数据问题标注内容不存在");
|
||||
|
||||
ErrorCode DATASET_FILES_NOT_EXISTS = new ErrorCode(10024, "数据集数据文件不存在");
|
||||
|
||||
ErrorCode DATASET_QUESTION_NOT_EXISTS = new ErrorCode(10025, "数据集数据问题不存在");
|
||||
|
||||
}
|
||||
|
@ -39,25 +39,21 @@ public class ApplicationRespVO {
|
||||
@ExcelProperty("模型服务,模型服务ID")
|
||||
private Long appModel;
|
||||
|
||||
@Schema(description = "随机性")
|
||||
@ExcelProperty("随机性")
|
||||
@Schema(description = "废弃, 随机性")
|
||||
@ExcelProperty("废弃, 随机性")
|
||||
private Integer temperature;
|
||||
|
||||
@Schema(description = "采样性")
|
||||
@ExcelProperty("采样性")
|
||||
@Schema(description = "废弃, 采样性")
|
||||
@ExcelProperty("废弃, 采样性")
|
||||
private Integer topP;
|
||||
|
||||
@Schema(description = "单次回复限制")
|
||||
@ExcelProperty("单次回复限制")
|
||||
@Schema(description = "废弃, 单次回复限制")
|
||||
@ExcelProperty("废弃, 单次回复限制")
|
||||
private Integer maxTokens;
|
||||
|
||||
@Schema(description = "系统Prompt")
|
||||
@ExcelProperty("系统Prompt")
|
||||
private String prompt;
|
||||
|
||||
@Schema(description = "向量知识库,知识库ID")
|
||||
@Schema(description = "向量知识库,知识库ID", example = "15511")
|
||||
@ExcelProperty("向量知识库,知识库ID")
|
||||
private Long retrievalAugmentedGeneration;
|
||||
private Long modelServiceId;
|
||||
|
||||
@Schema(description = "应用API地址", example = "https://www.iocoder.cn")
|
||||
@ExcelProperty("应用API地址")
|
||||
@ -75,10 +71,17 @@ public class ApplicationRespVO {
|
||||
@ExcelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@Schema(description = "大模型服务的推理参数,以JSON格式存储")
|
||||
@ExcelProperty("大模型服务的推理参数,以JSON格式存储")
|
||||
private String modelParams;
|
||||
|
||||
@Schema(description = "系统Prompt")
|
||||
@ExcelProperty("系统Prompt")
|
||||
private String prompt;
|
||||
|
||||
@Schema(description = "创建人id")
|
||||
private String creator;
|
||||
|
||||
@Schema(description = "创建人")
|
||||
private String creatorName;
|
||||
|
||||
}
|
||||
|
@ -9,10 +9,10 @@ import javax.validation.constraints.*;
|
||||
@Data
|
||||
public class ApplicationSaveReqVO {
|
||||
|
||||
@Schema(description = "应用ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "31452")
|
||||
@Schema(description = "应用ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "25658")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "应用名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "赵六")
|
||||
@Schema(description = "应用名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "王五")
|
||||
@NotEmpty(message = "应用名称不能为空")
|
||||
private String appName;
|
||||
|
||||
@ -30,20 +30,17 @@ public class ApplicationSaveReqVO {
|
||||
@Schema(description = "模型服务,模型服务ID")
|
||||
private Long appModel;
|
||||
|
||||
@Schema(description = "随机性")
|
||||
@Schema(description = "废弃, 随机性")
|
||||
private Integer temperature;
|
||||
|
||||
@Schema(description = "采样性")
|
||||
@Schema(description = "废弃, 采样性")
|
||||
private Integer topP;
|
||||
|
||||
@Schema(description = "单次回复限制")
|
||||
@Schema(description = "废弃, 单次回复限制")
|
||||
private Integer maxTokens;
|
||||
|
||||
@Schema(description = "系统Prompt")
|
||||
private String prompt;
|
||||
|
||||
@Schema(description = "向量知识库,知识库ID")
|
||||
private Long retrievalAugmentedGeneration;
|
||||
@Schema(description = "向量知识库,知识库ID", example = "15511")
|
||||
private Long modelServiceId;
|
||||
|
||||
@Schema(description = "应用API地址", example = "https://www.iocoder.cn")
|
||||
private String appUrl;
|
||||
@ -51,7 +48,18 @@ public class ApplicationSaveReqVO {
|
||||
@Schema(description = "应用图标")
|
||||
private String appLogo;
|
||||
|
||||
@Schema(description = "聊天人次", example = "8556")
|
||||
@Schema(description = "聊天人次", example = "20515")
|
||||
private Long chatCount;
|
||||
|
||||
}
|
||||
@Schema(description = "大模型服务的推理参数,以JSON格式存储")
|
||||
private String modelParams;
|
||||
|
||||
@Schema(description = "系统Prompt")
|
||||
private String prompt;
|
||||
|
||||
@Schema(description = "创建人id")
|
||||
private String creator;
|
||||
|
||||
@Schema(description = "创建人")
|
||||
private String creatorName;
|
||||
}
|
||||
|
@ -0,0 +1,95 @@
|
||||
package cn.iocoder.yudao.module.llm.controller.admin.basemodel;
|
||||
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import javax.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
|
||||
import javax.validation.constraints.*;
|
||||
import javax.validation.*;
|
||||
import javax.servlet.http.*;
|
||||
import java.util.*;
|
||||
import java.io.IOException;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
||||
|
||||
import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog;
|
||||
import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.*;
|
||||
|
||||
import cn.iocoder.yudao.module.llm.controller.admin.basemodel.vo.*;
|
||||
import cn.iocoder.yudao.module.llm.dal.dataobject.basemodel.BaseModelDO;
|
||||
import cn.iocoder.yudao.module.llm.service.basemodel.BaseModelService;
|
||||
|
||||
@Tag(name = "管理后台 - 基座模型")
|
||||
@RestController
|
||||
@RequestMapping("/llm/base-model")
|
||||
@Validated
|
||||
public class BaseModelController {
|
||||
|
||||
@Resource
|
||||
private BaseModelService baseModelService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建基座模型")
|
||||
@PreAuthorize("@ss.hasPermission('llm:base-model:create')")
|
||||
public CommonResult<Integer> createBaseModel(@Valid @RequestBody BaseModelSaveReqVO createReqVO) {
|
||||
return success(baseModelService.createBaseModel(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新基座模型")
|
||||
@PreAuthorize("@ss.hasPermission('llm:base-model:update')")
|
||||
public CommonResult<Boolean> updateBaseModel(@Valid @RequestBody BaseModelSaveReqVO updateReqVO) {
|
||||
baseModelService.updateBaseModel(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除基座模型")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('llm:base-model:delete')")
|
||||
public CommonResult<Boolean> deleteBaseModel(@RequestParam("id") Integer id) {
|
||||
baseModelService.deleteBaseModel(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得基座模型")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('llm:base-model:query')")
|
||||
public CommonResult<BaseModelRespVO> getBaseModel(@RequestParam("id") Integer id) {
|
||||
BaseModelDO baseModel = baseModelService.getBaseModel(id);
|
||||
return success(BeanUtils.toBean(baseModel, BaseModelRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得基座模型分页")
|
||||
@PreAuthorize("@ss.hasPermission('llm:base-model:query')")
|
||||
public CommonResult<PageResult<BaseModelRespVO>> getBaseModelPage(@Valid BaseModelPageReqVO pageReqVO) {
|
||||
PageResult<BaseModelDO> pageResult = baseModelService.getBaseModelPage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, BaseModelRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出基座模型 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('llm:base-model:export')")
|
||||
@ApiAccessLog(operateType = EXPORT)
|
||||
public void exportBaseModelExcel(@Valid BaseModelPageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<BaseModelDO> list = baseModelService.getBaseModelPage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "基座模型.xls", "数据", BaseModelRespVO.class,
|
||||
BeanUtils.toBean(list, BaseModelRespVO.class));
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,43 @@
|
||||
package cn.iocoder.yudao.module.llm.controller.admin.basemodel.vo;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@Schema(description = "管理后台 - 基座模型分页 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class BaseModelPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "基座模型名称", example = "张三")
|
||||
private String modelName;
|
||||
|
||||
@Schema(description = "参数量", example = "12388")
|
||||
private Integer parameterCount;
|
||||
|
||||
@Schema(description = "最大上下文长度")
|
||||
private Integer maxContextLength;
|
||||
|
||||
@Schema(description = "模型类型", example = "1")
|
||||
private String modelType;
|
||||
|
||||
@Schema(description = "是否启动")
|
||||
private Boolean isActive;
|
||||
|
||||
@Schema(description = "是否微调")
|
||||
private Boolean isFinetuned;
|
||||
|
||||
@Schema(description = "备注")
|
||||
private String notes;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
}
|
@ -0,0 +1,51 @@
|
||||
package cn.iocoder.yudao.module.llm.controller.admin.basemodel.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
import com.alibaba.excel.annotation.*;
|
||||
|
||||
@Schema(description = "管理后台 - 基座模型 Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class BaseModelRespVO {
|
||||
|
||||
@Schema(description = "基座模型唯一标识", requiredMode = Schema.RequiredMode.REQUIRED, example = "2828")
|
||||
@ExcelProperty("基座模型唯一标识")
|
||||
private Integer id;
|
||||
|
||||
@Schema(description = "基座模型名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "张三")
|
||||
@ExcelProperty("基座模型名称")
|
||||
private String modelName;
|
||||
|
||||
@Schema(description = "参数量", requiredMode = Schema.RequiredMode.REQUIRED, example = "12388")
|
||||
@ExcelProperty("参数量")
|
||||
private Integer parameterCount;
|
||||
|
||||
@Schema(description = "最大上下文长度", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("最大上下文长度")
|
||||
private Integer maxContextLength;
|
||||
|
||||
@Schema(description = "模型类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||
@ExcelProperty("模型类型")
|
||||
private String modelType;
|
||||
|
||||
@Schema(description = "是否启动", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("是否启动")
|
||||
private Boolean isActive;
|
||||
|
||||
@Schema(description = "是否微调", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("是否微调")
|
||||
private Boolean isFinetuned;
|
||||
|
||||
@Schema(description = "备注")
|
||||
@ExcelProperty("备注")
|
||||
private String notes;
|
||||
|
||||
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
}
|
@ -0,0 +1,42 @@
|
||||
package cn.iocoder.yudao.module.llm.controller.admin.basemodel.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
@Schema(description = "管理后台 - 基座模型新增/修改 Request VO")
|
||||
@Data
|
||||
public class BaseModelSaveReqVO {
|
||||
|
||||
@Schema(description = "基座模型唯一标识", requiredMode = Schema.RequiredMode.REQUIRED, example = "2828")
|
||||
private Integer id;
|
||||
|
||||
@Schema(description = "基座模型名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "张三")
|
||||
@NotEmpty(message = "基座模型名称不能为空")
|
||||
private String modelName;
|
||||
|
||||
@Schema(description = "参数量", requiredMode = Schema.RequiredMode.REQUIRED, example = "12388")
|
||||
@NotNull(message = "参数量不能为空")
|
||||
private Integer parameterCount;
|
||||
|
||||
@Schema(description = "最大上下文长度", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "最大上下文长度不能为空")
|
||||
private Integer maxContextLength;
|
||||
|
||||
@Schema(description = "模型类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||
@NotEmpty(message = "模型类型不能为空")
|
||||
private String modelType;
|
||||
|
||||
@Schema(description = "是否启动", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "是否启动不能为空")
|
||||
private Boolean isActive;
|
||||
|
||||
@Schema(description = "是否微调", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "是否微调不能为空")
|
||||
private Boolean isFinetuned;
|
||||
|
||||
@Schema(description = "备注")
|
||||
private String notes;
|
||||
|
||||
}
|
@ -0,0 +1,95 @@
|
||||
package cn.iocoder.yudao.module.llm.controller.admin.conversation;
|
||||
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import javax.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
|
||||
import javax.validation.constraints.*;
|
||||
import javax.validation.*;
|
||||
import javax.servlet.http.*;
|
||||
import java.util.*;
|
||||
import java.io.IOException;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
||||
|
||||
import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog;
|
||||
import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.*;
|
||||
|
||||
import cn.iocoder.yudao.module.llm.controller.admin.conversation.vo.*;
|
||||
import cn.iocoder.yudao.module.llm.dal.dataobject.conversation.ConversationDO;
|
||||
import cn.iocoder.yudao.module.llm.service.conversation.ConversationService;
|
||||
|
||||
@Tag(name = "管理后台 - 大模型对话记录")
|
||||
@RestController
|
||||
@RequestMapping("/llm/conversation")
|
||||
@Validated
|
||||
public class ConversationController {
|
||||
|
||||
@Resource
|
||||
private ConversationService conversationService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建大模型对话记录")
|
||||
@PreAuthorize("@ss.hasPermission('llm:conversation:create')")
|
||||
public CommonResult<Integer> createConversation(@Valid @RequestBody ConversationSaveReqVO createReqVO) {
|
||||
return success(conversationService.createConversation(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新大模型对话记录")
|
||||
@PreAuthorize("@ss.hasPermission('llm:conversation:update')")
|
||||
public CommonResult<Boolean> updateConversation(@Valid @RequestBody ConversationSaveReqVO updateReqVO) {
|
||||
conversationService.updateConversation(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除大模型对话记录")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('llm:conversation:delete')")
|
||||
public CommonResult<Boolean> deleteConversation(@RequestParam("id") Integer id) {
|
||||
conversationService.deleteConversation(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得大模型对话记录")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('llm:conversation:query')")
|
||||
public CommonResult<ConversationRespVO> getConversation(@RequestParam("id") Integer id) {
|
||||
ConversationDO conversation = conversationService.getConversation(id);
|
||||
return success(BeanUtils.toBean(conversation, ConversationRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得大模型对话记录分页")
|
||||
@PreAuthorize("@ss.hasPermission('llm:conversation:query')")
|
||||
public CommonResult<PageResult<ConversationRespVO>> getConversationPage(@Valid ConversationPageReqVO pageReqVO) {
|
||||
PageResult<ConversationDO> pageResult = conversationService.getConversationPage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, ConversationRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出大模型对话记录 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('llm:conversation:export')")
|
||||
@ApiAccessLog(operateType = EXPORT)
|
||||
public void exportConversationExcel(@Valid ConversationPageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<ConversationDO> list = conversationService.getConversationPage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "大模型对话记录.xls", "数据", ConversationRespVO.class,
|
||||
BeanUtils.toBean(list, ConversationRespVO.class));
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,43 @@
|
||||
package cn.iocoder.yudao.module.llm.controller.admin.conversation.vo;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@Schema(description = "管理后台 - 大模型对话记录分页 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class ConversationPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "对话中的角色: user, assistant, system")
|
||||
private String role;
|
||||
|
||||
@Schema(description = "对话的内容")
|
||||
private String content;
|
||||
|
||||
@Schema(description = "推理参数,采用 JSON 格式")
|
||||
private String modelParams;
|
||||
|
||||
@Schema(description = "提示词")
|
||||
private String prompt;
|
||||
|
||||
@Schema(description = "知识库相关信息", example = "15002")
|
||||
private String knowledgeBaseId;
|
||||
|
||||
@Schema(description = "应用ID", example = "31046")
|
||||
private Long applicationId;
|
||||
|
||||
@Schema(description = "模型服务ID", example = "2904")
|
||||
private Long modelServiceId;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
}
|
@ -0,0 +1,51 @@
|
||||
package cn.iocoder.yudao.module.llm.controller.admin.conversation.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
import com.alibaba.excel.annotation.*;
|
||||
|
||||
@Schema(description = "管理后台 - 大模型对话记录 Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class ConversationRespVO {
|
||||
|
||||
@Schema(description = "对话记录的唯一标识", requiredMode = Schema.RequiredMode.REQUIRED, example = "17037")
|
||||
@ExcelProperty("对话记录的唯一标识")
|
||||
private Integer id;
|
||||
|
||||
@Schema(description = "对话中的角色: user, assistant, system", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("对话中的角色: user, assistant, system")
|
||||
private String role;
|
||||
|
||||
@Schema(description = "对话的内容", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("对话的内容")
|
||||
private String content;
|
||||
|
||||
@Schema(description = "推理参数,采用 JSON 格式")
|
||||
@ExcelProperty("推理参数,采用 JSON 格式")
|
||||
private String modelParams;
|
||||
|
||||
@Schema(description = "提示词")
|
||||
@ExcelProperty("提示词")
|
||||
private String prompt;
|
||||
|
||||
@Schema(description = "知识库相关信息", example = "15002")
|
||||
@ExcelProperty("知识库相关信息")
|
||||
private String knowledgeBaseId;
|
||||
|
||||
@Schema(description = "应用ID", example = "31046")
|
||||
@ExcelProperty("应用ID")
|
||||
private Long applicationId;
|
||||
|
||||
@Schema(description = "模型服务ID", example = "2904")
|
||||
@ExcelProperty("模型服务ID")
|
||||
private Long modelServiceId;
|
||||
|
||||
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
}
|
@ -0,0 +1,38 @@
|
||||
package cn.iocoder.yudao.module.llm.controller.admin.conversation.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
@Schema(description = "管理后台 - 大模型对话记录新增/修改 Request VO")
|
||||
@Data
|
||||
public class ConversationSaveReqVO {
|
||||
|
||||
@Schema(description = "对话记录的唯一标识", requiredMode = Schema.RequiredMode.REQUIRED, example = "17037")
|
||||
private Integer id;
|
||||
|
||||
@Schema(description = "对话中的角色: user, assistant, system", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotEmpty(message = "对话中的角色: user, assistant, system不能为空")
|
||||
private String role;
|
||||
|
||||
@Schema(description = "对话的内容", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotEmpty(message = "对话的内容不能为空")
|
||||
private String content;
|
||||
|
||||
@Schema(description = "推理参数,采用 JSON 格式")
|
||||
private String modelParams;
|
||||
|
||||
@Schema(description = "提示词")
|
||||
private String prompt;
|
||||
|
||||
@Schema(description = "知识库相关信息", example = "15002")
|
||||
private String knowledgeBaseId;
|
||||
|
||||
@Schema(description = "应用ID", example = "31046")
|
||||
private Long applicationId;
|
||||
|
||||
@Schema(description = "模型服务ID", example = "2904")
|
||||
private Long modelServiceId;
|
||||
|
||||
}
|
@ -0,0 +1,95 @@
|
||||
package cn.iocoder.yudao.module.llm.controller.admin.dataprocesstask;
|
||||
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import javax.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
|
||||
import javax.validation.constraints.*;
|
||||
import javax.validation.*;
|
||||
import javax.servlet.http.*;
|
||||
import java.util.*;
|
||||
import java.io.IOException;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
||||
|
||||
import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog;
|
||||
import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.*;
|
||||
|
||||
import cn.iocoder.yudao.module.llm.controller.admin.dataprocesstask.vo.*;
|
||||
import cn.iocoder.yudao.module.llm.dal.dataobject.dataprocesstask.DataProcessTaskDO;
|
||||
import cn.iocoder.yudao.module.llm.service.dataprocesstask.DataProcessTaskService;
|
||||
|
||||
@Tag(name = "管理后台 - 数据处理任务")
|
||||
@RestController
|
||||
@RequestMapping("/llm/data-process-task")
|
||||
@Validated
|
||||
public class DataProcessTaskController {
|
||||
|
||||
@Resource
|
||||
private DataProcessTaskService dataProcessTaskService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建数据处理任务")
|
||||
@PreAuthorize("@ss.hasPermission('llm:data-process-task:create')")
|
||||
public CommonResult<Long> createDataProcessTask(@Valid @RequestBody DataProcessTaskSaveReqVO createReqVO) {
|
||||
return success(dataProcessTaskService.createDataProcessTask(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新数据处理任务")
|
||||
@PreAuthorize("@ss.hasPermission('llm:data-process-task:update')")
|
||||
public CommonResult<Boolean> updateDataProcessTask(@Valid @RequestBody DataProcessTaskSaveReqVO updateReqVO) {
|
||||
dataProcessTaskService.updateDataProcessTask(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除数据处理任务")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('llm:data-process-task:delete')")
|
||||
public CommonResult<Boolean> deleteDataProcessTask(@RequestParam("id") Long id) {
|
||||
dataProcessTaskService.deleteDataProcessTask(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得数据处理任务")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('llm:data-process-task:query')")
|
||||
public CommonResult<DataProcessTaskRespVO> getDataProcessTask(@RequestParam("id") Long id) {
|
||||
DataProcessTaskDO dataProcessTask = dataProcessTaskService.getDataProcessTask(id);
|
||||
return success(BeanUtils.toBean(dataProcessTask, DataProcessTaskRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得数据处理任务分页")
|
||||
@PreAuthorize("@ss.hasPermission('llm:data-process-task:query')")
|
||||
public CommonResult<PageResult<DataProcessTaskRespVO>> getDataProcessTaskPage(@Valid DataProcessTaskPageReqVO pageReqVO) {
|
||||
PageResult<DataProcessTaskDO> pageResult = dataProcessTaskService.getDataProcessTaskPage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, DataProcessTaskRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出数据处理任务 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('llm:data-process-task:export')")
|
||||
@ApiAccessLog(operateType = EXPORT)
|
||||
public void exportDataProcessTaskExcel(@Valid DataProcessTaskPageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<DataProcessTaskDO> list = dataProcessTaskService.getDataProcessTaskPage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "数据处理任务.xls", "数据", DataProcessTaskRespVO.class,
|
||||
BeanUtils.toBean(list, DataProcessTaskRespVO.class));
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,37 @@
|
||||
package cn.iocoder.yudao.module.llm.controller.admin.dataprocesstask.vo;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@Schema(description = "管理后台 - 数据处理任务分页 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class DataProcessTaskPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "任务名称", example = "王五")
|
||||
private String taskName;
|
||||
|
||||
@Schema(description = "处理前数据集ID", example = "21087")
|
||||
private Long datasetId;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
@Schema(description = "状态,使用字典(llm_data_process_status)", example = "2")
|
||||
private Integer status;
|
||||
|
||||
@Schema(description = "处理后的数据集ID", example = "27877")
|
||||
private Long datasetPostId;
|
||||
|
||||
@Schema(description = "配置信息")
|
||||
private String options;
|
||||
|
||||
}
|
@ -0,0 +1,43 @@
|
||||
package cn.iocoder.yudao.module.llm.controller.admin.dataprocesstask.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
import com.alibaba.excel.annotation.*;
|
||||
|
||||
@Schema(description = "管理后台 - 数据处理任务 Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class DataProcessTaskRespVO {
|
||||
|
||||
@Schema(description = "数据处理任务ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "24850")
|
||||
@ExcelProperty("数据处理任务ID")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "任务名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "王五")
|
||||
@ExcelProperty("任务名称")
|
||||
private String taskName;
|
||||
|
||||
@Schema(description = "处理前数据集ID", example = "21087")
|
||||
@ExcelProperty("处理前数据集ID")
|
||||
private Long datasetId;
|
||||
|
||||
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@Schema(description = "状态,使用字典(llm_data_process_status)", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
|
||||
@ExcelProperty("状态,使用字典(llm_data_process_status)")
|
||||
private Integer status;
|
||||
|
||||
@Schema(description = "处理后的数据集ID", example = "27877")
|
||||
@ExcelProperty("处理后的数据集ID")
|
||||
private Long datasetPostId;
|
||||
|
||||
@Schema(description = "配置信息")
|
||||
@ExcelProperty("配置信息")
|
||||
private String options;
|
||||
|
||||
}
|
@ -0,0 +1,32 @@
|
||||
package cn.iocoder.yudao.module.llm.controller.admin.dataprocesstask.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
@Schema(description = "管理后台 - 数据处理任务新增/修改 Request VO")
|
||||
@Data
|
||||
public class DataProcessTaskSaveReqVO {
|
||||
|
||||
@Schema(description = "数据处理任务ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "24850")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "任务名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "王五")
|
||||
@NotEmpty(message = "任务名称不能为空")
|
||||
private String taskName;
|
||||
|
||||
@Schema(description = "处理前数据集ID", example = "21087")
|
||||
private Long datasetId;
|
||||
|
||||
@Schema(description = "状态,使用字典(llm_data_process_status)", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
|
||||
@NotNull(message = "状态,使用字典(llm_data_process_status)不能为空")
|
||||
private Integer status;
|
||||
|
||||
@Schema(description = "处理后的数据集ID", example = "27877")
|
||||
private Long datasetPostId;
|
||||
|
||||
@Schema(description = "配置信息")
|
||||
private String options;
|
||||
|
||||
}
|
@ -0,0 +1,95 @@
|
||||
package cn.iocoder.yudao.module.llm.controller.admin.datasetanswer;
|
||||
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import javax.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
|
||||
import javax.validation.constraints.*;
|
||||
import javax.validation.*;
|
||||
import javax.servlet.http.*;
|
||||
import java.util.*;
|
||||
import java.io.IOException;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
||||
|
||||
import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog;
|
||||
import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.*;
|
||||
|
||||
import cn.iocoder.yudao.module.llm.controller.admin.datasetanswer.vo.*;
|
||||
import cn.iocoder.yudao.module.llm.dal.dataobject.datasetanswer.DatasetAnswerDO;
|
||||
import cn.iocoder.yudao.module.llm.service.datasetanswer.DatasetAnswerService;
|
||||
|
||||
@Tag(name = "管理后台 - 数据集数据问题标注内容")
|
||||
@RestController
|
||||
@RequestMapping("/llm/dataset-answer")
|
||||
@Validated
|
||||
public class DatasetAnswerController {
|
||||
|
||||
@Resource
|
||||
private DatasetAnswerService datasetAnswerService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建数据集数据问题标注内容")
|
||||
@PreAuthorize("@ss.hasPermission('llm:dataset-answer:create')")
|
||||
public CommonResult<Long> createDatasetAnswer(@Valid @RequestBody DatasetAnswerSaveReqVO createReqVO) {
|
||||
return success(datasetAnswerService.createDatasetAnswer(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新数据集数据问题标注内容")
|
||||
@PreAuthorize("@ss.hasPermission('llm:dataset-answer:update')")
|
||||
public CommonResult<Boolean> updateDatasetAnswer(@Valid @RequestBody DatasetAnswerSaveReqVO updateReqVO) {
|
||||
datasetAnswerService.updateDatasetAnswer(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除数据集数据问题标注内容")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('llm:dataset-answer:delete')")
|
||||
public CommonResult<Boolean> deleteDatasetAnswer(@RequestParam("id") Long id) {
|
||||
datasetAnswerService.deleteDatasetAnswer(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得数据集数据问题标注内容")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('llm:dataset-answer:query')")
|
||||
public CommonResult<DatasetAnswerRespVO> getDatasetAnswer(@RequestParam("id") Long id) {
|
||||
DatasetAnswerDO datasetAnswer = datasetAnswerService.getDatasetAnswer(id);
|
||||
return success(BeanUtils.toBean(datasetAnswer, DatasetAnswerRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得数据集数据问题标注内容分页")
|
||||
@PreAuthorize("@ss.hasPermission('llm:dataset-answer:query')")
|
||||
public CommonResult<PageResult<DatasetAnswerRespVO>> getDatasetAnswerPage(@Valid DatasetAnswerPageReqVO pageReqVO) {
|
||||
PageResult<DatasetAnswerDO> pageResult = datasetAnswerService.getDatasetAnswerPage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, DatasetAnswerRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出数据集数据问题标注内容 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('llm:dataset-answer:export')")
|
||||
@ApiAccessLog(operateType = EXPORT)
|
||||
public void exportDatasetAnswerExcel(@Valid DatasetAnswerPageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<DatasetAnswerDO> list = datasetAnswerService.getDatasetAnswerPage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "数据集数据问题标注内容.xls", "数据", DatasetAnswerRespVO.class,
|
||||
BeanUtils.toBean(list, DatasetAnswerRespVO.class));
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,34 @@
|
||||
package cn.iocoder.yudao.module.llm.controller.admin.datasetanswer.vo;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@Schema(description = "管理后台 - 数据集数据问题标注内容分页 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class DatasetAnswerPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "数据集ID", example = "23968")
|
||||
private Long datasetId;
|
||||
|
||||
@Schema(description = "数据文件ID", example = "502")
|
||||
private Long datasetFilesId;
|
||||
|
||||
@Schema(description = "问题ID", example = "8932")
|
||||
private Long questionId;
|
||||
|
||||
@Schema(description = "标注内容")
|
||||
private String answer;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
}
|
@ -0,0 +1,39 @@
|
||||
package cn.iocoder.yudao.module.llm.controller.admin.datasetanswer.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
import com.alibaba.excel.annotation.*;
|
||||
|
||||
@Schema(description = "管理后台 - 数据集数据问题标注内容 Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class DatasetAnswerRespVO {
|
||||
|
||||
@Schema(description = "数据集问题ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "4634")
|
||||
@ExcelProperty("数据集问题ID")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "数据集ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "23968")
|
||||
@ExcelProperty("数据集ID")
|
||||
private Long datasetId;
|
||||
|
||||
@Schema(description = "数据文件ID", example = "502")
|
||||
@ExcelProperty("数据文件ID")
|
||||
private Long datasetFilesId;
|
||||
|
||||
@Schema(description = "问题ID", example = "8932")
|
||||
@ExcelProperty("问题ID")
|
||||
private Long questionId;
|
||||
|
||||
@Schema(description = "标注内容")
|
||||
@ExcelProperty("标注内容")
|
||||
private String answer;
|
||||
|
||||
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
}
|
@ -0,0 +1,28 @@
|
||||
package cn.iocoder.yudao.module.llm.controller.admin.datasetanswer.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
@Schema(description = "管理后台 - 数据集数据问题标注内容新增/修改 Request VO")
|
||||
@Data
|
||||
public class DatasetAnswerSaveReqVO {
|
||||
|
||||
@Schema(description = "数据集问题ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "4634")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "数据集ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "23968")
|
||||
@NotNull(message = "数据集ID不能为空")
|
||||
private Long datasetId;
|
||||
|
||||
@Schema(description = "数据文件ID", example = "502")
|
||||
private Long datasetFilesId;
|
||||
|
||||
@Schema(description = "问题ID", example = "8932")
|
||||
private Long questionId;
|
||||
|
||||
@Schema(description = "标注内容")
|
||||
private String answer;
|
||||
|
||||
}
|
@ -0,0 +1,95 @@
|
||||
package cn.iocoder.yudao.module.llm.controller.admin.datasetfiles;
|
||||
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import javax.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
|
||||
import javax.validation.constraints.*;
|
||||
import javax.validation.*;
|
||||
import javax.servlet.http.*;
|
||||
import java.util.*;
|
||||
import java.io.IOException;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
||||
|
||||
import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog;
|
||||
import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.*;
|
||||
|
||||
import cn.iocoder.yudao.module.llm.controller.admin.datasetfiles.vo.*;
|
||||
import cn.iocoder.yudao.module.llm.dal.dataobject.datasetfiles.DatasetFilesDO;
|
||||
import cn.iocoder.yudao.module.llm.service.datasetfiles.DatasetFilesService;
|
||||
|
||||
@Tag(name = "管理后台 - 数据集数据文件")
|
||||
@RestController
|
||||
@RequestMapping("/llm/dataset-files")
|
||||
@Validated
|
||||
public class DatasetFilesController {
|
||||
|
||||
@Resource
|
||||
private DatasetFilesService datasetFilesService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建数据集数据文件")
|
||||
@PreAuthorize("@ss.hasPermission('llm:dataset-files:create')")
|
||||
public CommonResult<Long> createDatasetFiles(@Valid @RequestBody DatasetFilesSaveReqVO createReqVO) {
|
||||
return success(datasetFilesService.createDatasetFiles(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新数据集数据文件")
|
||||
@PreAuthorize("@ss.hasPermission('llm:dataset-files:update')")
|
||||
public CommonResult<Boolean> updateDatasetFiles(@Valid @RequestBody DatasetFilesSaveReqVO updateReqVO) {
|
||||
datasetFilesService.updateDatasetFiles(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除数据集数据文件")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('llm:dataset-files:delete')")
|
||||
public CommonResult<Boolean> deleteDatasetFiles(@RequestParam("id") Long id) {
|
||||
datasetFilesService.deleteDatasetFiles(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得数据集数据文件")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('llm:dataset-files:query')")
|
||||
public CommonResult<DatasetFilesRespVO> getDatasetFiles(@RequestParam("id") Long id) {
|
||||
DatasetFilesDO datasetFiles = datasetFilesService.getDatasetFiles(id);
|
||||
return success(BeanUtils.toBean(datasetFiles, DatasetFilesRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得数据集数据文件分页")
|
||||
@PreAuthorize("@ss.hasPermission('llm:dataset-files:query')")
|
||||
public CommonResult<PageResult<DatasetFilesRespVO>> getDatasetFilesPage(@Valid DatasetFilesPageReqVO pageReqVO) {
|
||||
PageResult<DatasetFilesDO> pageResult = datasetFilesService.getDatasetFilesPage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, DatasetFilesRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出数据集数据文件 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('llm:dataset-files:export')")
|
||||
@ApiAccessLog(operateType = EXPORT)
|
||||
public void exportDatasetFilesExcel(@Valid DatasetFilesPageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<DatasetFilesDO> list = datasetFilesService.getDatasetFilesPage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "数据集数据文件.xls", "数据", DatasetFilesRespVO.class,
|
||||
BeanUtils.toBean(list, DatasetFilesRespVO.class));
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,34 @@
|
||||
package cn.iocoder.yudao.module.llm.controller.admin.datasetfiles.vo;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@Schema(description = "管理后台 - 数据集数据文件分页 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class DatasetFilesPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "数据集ID", example = "23558")
|
||||
private Long datasetId;
|
||||
|
||||
@Schema(description = "数据长度")
|
||||
private Long dataLength;
|
||||
|
||||
@Schema(description = "数据文件(文件表的ID)")
|
||||
private Long datasetFile;
|
||||
|
||||
@Schema(description = "文件URL地址", example = "https://www.iocoder.cn")
|
||||
private String datasetFileUrl;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
}
|
@ -0,0 +1,39 @@
|
||||
package cn.iocoder.yudao.module.llm.controller.admin.datasetfiles.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
import com.alibaba.excel.annotation.*;
|
||||
|
||||
@Schema(description = "管理后台 - 数据集数据文件 Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class DatasetFilesRespVO {
|
||||
|
||||
@Schema(description = "数据集ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "32334")
|
||||
@ExcelProperty("数据集ID")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "数据集ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "23558")
|
||||
@ExcelProperty("数据集ID")
|
||||
private Long datasetId;
|
||||
|
||||
@Schema(description = "数据长度")
|
||||
@ExcelProperty("数据长度")
|
||||
private Long dataLength;
|
||||
|
||||
@Schema(description = "数据文件(文件表的ID)")
|
||||
@ExcelProperty("数据文件(文件表的ID)")
|
||||
private Long datasetFile;
|
||||
|
||||
@Schema(description = "文件URL地址", example = "https://www.iocoder.cn")
|
||||
@ExcelProperty("文件URL地址")
|
||||
private String datasetFileUrl;
|
||||
|
||||
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
}
|
@ -0,0 +1,28 @@
|
||||
package cn.iocoder.yudao.module.llm.controller.admin.datasetfiles.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
@Schema(description = "管理后台 - 数据集数据文件新增/修改 Request VO")
|
||||
@Data
|
||||
public class DatasetFilesSaveReqVO {
|
||||
|
||||
@Schema(description = "数据集ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "32334")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "数据集ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "23558")
|
||||
@NotNull(message = "数据集ID不能为空")
|
||||
private Long datasetId;
|
||||
|
||||
@Schema(description = "数据长度")
|
||||
private Long dataLength;
|
||||
|
||||
@Schema(description = "数据文件(文件表的ID)")
|
||||
private Long datasetFile;
|
||||
|
||||
@Schema(description = "文件URL地址", example = "https://www.iocoder.cn")
|
||||
private String datasetFileUrl;
|
||||
|
||||
}
|
@ -0,0 +1,95 @@
|
||||
package cn.iocoder.yudao.module.llm.controller.admin.datasetquestion;
|
||||
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import javax.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
|
||||
import javax.validation.constraints.*;
|
||||
import javax.validation.*;
|
||||
import javax.servlet.http.*;
|
||||
import java.util.*;
|
||||
import java.io.IOException;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
||||
|
||||
import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog;
|
||||
import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.*;
|
||||
|
||||
import cn.iocoder.yudao.module.llm.controller.admin.datasetquestion.vo.*;
|
||||
import cn.iocoder.yudao.module.llm.dal.dataobject.datasetquestion.DatasetQuestionDO;
|
||||
import cn.iocoder.yudao.module.llm.service.datasetquestion.DatasetQuestionService;
|
||||
|
||||
@Tag(name = "管理后台 - 数据集数据问题")
|
||||
@RestController
|
||||
@RequestMapping("/llm/dataset-question")
|
||||
@Validated
|
||||
public class DatasetQuestionController {
|
||||
|
||||
@Resource
|
||||
private DatasetQuestionService datasetQuestionService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建数据集数据问题")
|
||||
@PreAuthorize("@ss.hasPermission('llm:dataset-question:create')")
|
||||
public CommonResult<Long> createDatasetQuestion(@Valid @RequestBody DatasetQuestionSaveReqVO createReqVO) {
|
||||
return success(datasetQuestionService.createDatasetQuestion(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新数据集数据问题")
|
||||
@PreAuthorize("@ss.hasPermission('llm:dataset-question:update')")
|
||||
public CommonResult<Boolean> updateDatasetQuestion(@Valid @RequestBody DatasetQuestionSaveReqVO updateReqVO) {
|
||||
datasetQuestionService.updateDatasetQuestion(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除数据集数据问题")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('llm:dataset-question:delete')")
|
||||
public CommonResult<Boolean> deleteDatasetQuestion(@RequestParam("id") Long id) {
|
||||
datasetQuestionService.deleteDatasetQuestion(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得数据集数据问题")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('llm:dataset-question:query')")
|
||||
public CommonResult<DatasetQuestionRespVO> getDatasetQuestion(@RequestParam("id") Long id) {
|
||||
DatasetQuestionDO datasetQuestion = datasetQuestionService.getDatasetQuestion(id);
|
||||
return success(BeanUtils.toBean(datasetQuestion, DatasetQuestionRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得数据集数据问题分页")
|
||||
@PreAuthorize("@ss.hasPermission('llm:dataset-question:query')")
|
||||
public CommonResult<PageResult<DatasetQuestionRespVO>> getDatasetQuestionPage(@Valid DatasetQuestionPageReqVO pageReqVO) {
|
||||
PageResult<DatasetQuestionDO> pageResult = datasetQuestionService.getDatasetQuestionPage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, DatasetQuestionRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出数据集数据问题 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('llm:dataset-question:export')")
|
||||
@ApiAccessLog(operateType = EXPORT)
|
||||
public void exportDatasetQuestionExcel(@Valid DatasetQuestionPageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<DatasetQuestionDO> list = datasetQuestionService.getDatasetQuestionPage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "数据集数据问题.xls", "数据", DatasetQuestionRespVO.class,
|
||||
BeanUtils.toBean(list, DatasetQuestionRespVO.class));
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,34 @@
|
||||
package cn.iocoder.yudao.module.llm.controller.admin.datasetquestion.vo;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@Schema(description = "管理后台 - 数据集数据问题分页 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class DatasetQuestionPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "数据集ID", example = "21903")
|
||||
private Long datasetId;
|
||||
|
||||
@Schema(description = "数据文件ID", example = "13049")
|
||||
private Long datasetFilesId;
|
||||
|
||||
@Schema(description = "问题内容")
|
||||
private String question;
|
||||
|
||||
@Schema(description = "标注状态,使用字典(llm_dataset_mark_status)", example = "1")
|
||||
private Integer status;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
}
|
@ -0,0 +1,39 @@
|
||||
package cn.iocoder.yudao.module.llm.controller.admin.datasetquestion.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
import com.alibaba.excel.annotation.*;
|
||||
|
||||
@Schema(description = "管理后台 - 数据集数据问题 Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class DatasetQuestionRespVO {
|
||||
|
||||
@Schema(description = "数据集问题ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "14464")
|
||||
@ExcelProperty("数据集问题ID")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "数据集ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "21903")
|
||||
@ExcelProperty("数据集ID")
|
||||
private Long datasetId;
|
||||
|
||||
@Schema(description = "数据文件ID", example = "13049")
|
||||
@ExcelProperty("数据文件ID")
|
||||
private Long datasetFilesId;
|
||||
|
||||
@Schema(description = "问题内容")
|
||||
@ExcelProperty("问题内容")
|
||||
private String question;
|
||||
|
||||
@Schema(description = "标注状态,使用字典(llm_dataset_mark_status)", example = "1")
|
||||
@ExcelProperty("标注状态,使用字典(llm_dataset_mark_status)")
|
||||
private Integer status;
|
||||
|
||||
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
}
|
@ -0,0 +1,28 @@
|
||||
package cn.iocoder.yudao.module.llm.controller.admin.datasetquestion.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
@Schema(description = "管理后台 - 数据集数据问题新增/修改 Request VO")
|
||||
@Data
|
||||
public class DatasetQuestionSaveReqVO {
|
||||
|
||||
@Schema(description = "数据集问题ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "14464")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "数据集ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "21903")
|
||||
@NotNull(message = "数据集ID不能为空")
|
||||
private Long datasetId;
|
||||
|
||||
@Schema(description = "数据文件ID", example = "13049")
|
||||
private Long datasetFilesId;
|
||||
|
||||
@Schema(description = "问题内容")
|
||||
private String question;
|
||||
|
||||
@Schema(description = "标注状态,使用字典(llm_dataset_mark_status)", example = "1")
|
||||
private Integer status;
|
||||
|
||||
}
|
@ -0,0 +1,95 @@
|
||||
package cn.iocoder.yudao.module.llm.controller.admin.finetuning;
|
||||
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import javax.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
|
||||
import javax.validation.constraints.*;
|
||||
import javax.validation.*;
|
||||
import javax.servlet.http.*;
|
||||
import java.util.*;
|
||||
import java.io.IOException;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
||||
|
||||
import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog;
|
||||
import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.*;
|
||||
|
||||
import cn.iocoder.yudao.module.llm.controller.admin.finetuning.vo.*;
|
||||
import cn.iocoder.yudao.module.llm.dal.dataobject.finetuning.FineTuningDO;
|
||||
import cn.iocoder.yudao.module.llm.service.finetuning.FineTuningService;
|
||||
|
||||
@Tag(name = "管理后台 - 模型微调")
|
||||
@RestController
|
||||
@RequestMapping("/llm/fine-tuning")
|
||||
@Validated
|
||||
public class FineTuningController {
|
||||
|
||||
@Resource
|
||||
private FineTuningService fineTuningService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建模型微调")
|
||||
@PreAuthorize("@ss.hasPermission('llm:fine-tuning:create')")
|
||||
public CommonResult<Integer> createFineTuning(@Valid @RequestBody FineTuningSaveReqVO createReqVO) {
|
||||
return success(fineTuningService.createFineTuning(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新模型微调")
|
||||
@PreAuthorize("@ss.hasPermission('llm:fine-tuning:update')")
|
||||
public CommonResult<Boolean> updateFineTuning(@Valid @RequestBody FineTuningSaveReqVO updateReqVO) {
|
||||
fineTuningService.updateFineTuning(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除模型微调")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('llm:fine-tuning:delete')")
|
||||
public CommonResult<Boolean> deleteFineTuning(@RequestParam("id") Integer id) {
|
||||
fineTuningService.deleteFineTuning(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得模型微调")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('llm:fine-tuning:query')")
|
||||
public CommonResult<FineTuningRespVO> getFineTuning(@RequestParam("id") Integer id) {
|
||||
FineTuningDO fineTuning = fineTuningService.getFineTuning(id);
|
||||
return success(BeanUtils.toBean(fineTuning, FineTuningRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得模型微调分页")
|
||||
@PreAuthorize("@ss.hasPermission('llm:fine-tuning:query')")
|
||||
public CommonResult<PageResult<FineTuningRespVO>> getFineTuningPage(@Valid FineTuningPageReqVO pageReqVO) {
|
||||
PageResult<FineTuningDO> pageResult = fineTuningService.getFineTuningPage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, FineTuningRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出模型微调 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('llm:fine-tuning:export')")
|
||||
@ApiAccessLog(operateType = EXPORT)
|
||||
public void exportFineTuningExcel(@Valid FineTuningPageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<FineTuningDO> list = fineTuningService.getFineTuningPage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "模型微调.xls", "数据", FineTuningRespVO.class,
|
||||
BeanUtils.toBean(list, FineTuningRespVO.class));
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,41 @@
|
||||
package cn.iocoder.yudao.module.llm.controller.admin.finetuning.vo;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import java.math.BigDecimal;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@Schema(description = "管理后台 - 模型微调分页 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class FineTuningPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "关联的基座模型ID", example = "8253")
|
||||
private Integer baseModelId;
|
||||
|
||||
@Schema(description = "训练数据量")
|
||||
private Integer trainingDataSize;
|
||||
|
||||
@Schema(description = "评估数据集")
|
||||
private String evaluationDataset;
|
||||
|
||||
@Schema(description = "平均分")
|
||||
private BigDecimal averageScore;
|
||||
|
||||
@Schema(description = "评估状态", example = "1")
|
||||
private String evaluationStatus;
|
||||
|
||||
@Schema(description = "lora路径")
|
||||
private String loraPath;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
}
|
@ -0,0 +1,48 @@
|
||||
package cn.iocoder.yudao.module.llm.controller.admin.finetuning.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import java.math.BigDecimal;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
import com.alibaba.excel.annotation.*;
|
||||
|
||||
@Schema(description = "管理后台 - 模型微调 Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class FineTuningRespVO {
|
||||
|
||||
@Schema(description = "微调记录唯一标识", requiredMode = Schema.RequiredMode.REQUIRED, example = "12275")
|
||||
@ExcelProperty("微调记录唯一标识")
|
||||
private Integer id;
|
||||
|
||||
@Schema(description = "关联的基座模型ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "8253")
|
||||
@ExcelProperty("关联的基座模型ID")
|
||||
private Integer baseModelId;
|
||||
|
||||
@Schema(description = "训练数据量", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("训练数据量")
|
||||
private Integer trainingDataSize;
|
||||
|
||||
@Schema(description = "评估数据集", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("评估数据集")
|
||||
private String evaluationDataset;
|
||||
|
||||
@Schema(description = "平均分")
|
||||
@ExcelProperty("平均分")
|
||||
private BigDecimal averageScore;
|
||||
|
||||
@Schema(description = "评估状态", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||
@ExcelProperty("评估状态")
|
||||
private String evaluationStatus;
|
||||
|
||||
@Schema(description = "lora路径")
|
||||
@ExcelProperty("lora路径")
|
||||
private String loraPath;
|
||||
|
||||
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
}
|
@ -0,0 +1,38 @@
|
||||
package cn.iocoder.yudao.module.llm.controller.admin.finetuning.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import javax.validation.constraints.*;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@Schema(description = "管理后台 - 模型微调新增/修改 Request VO")
|
||||
@Data
|
||||
public class FineTuningSaveReqVO {
|
||||
|
||||
@Schema(description = "微调记录唯一标识", requiredMode = Schema.RequiredMode.REQUIRED, example = "12275")
|
||||
private Integer id;
|
||||
|
||||
@Schema(description = "关联的基座模型ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "8253")
|
||||
@NotNull(message = "关联的基座模型ID不能为空")
|
||||
private Integer baseModelId;
|
||||
|
||||
@Schema(description = "训练数据量", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "训练数据量不能为空")
|
||||
private Integer trainingDataSize;
|
||||
|
||||
@Schema(description = "评估数据集", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotEmpty(message = "评估数据集不能为空")
|
||||
private String evaluationDataset;
|
||||
|
||||
@Schema(description = "平均分")
|
||||
private BigDecimal averageScore;
|
||||
|
||||
@Schema(description = "评估状态", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||
@NotEmpty(message = "评估状态不能为空")
|
||||
private String evaluationStatus;
|
||||
|
||||
@Schema(description = "lora路径")
|
||||
private String loraPath;
|
||||
|
||||
}
|
@ -0,0 +1,95 @@
|
||||
package cn.iocoder.yudao.module.llm.controller.admin.finetuningloss;
|
||||
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import javax.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
|
||||
import javax.validation.constraints.*;
|
||||
import javax.validation.*;
|
||||
import javax.servlet.http.*;
|
||||
import java.util.*;
|
||||
import java.io.IOException;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
||||
|
||||
import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog;
|
||||
import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.*;
|
||||
|
||||
import cn.iocoder.yudao.module.llm.controller.admin.finetuningloss.vo.*;
|
||||
import cn.iocoder.yudao.module.llm.dal.dataobject.finetuningloss.FineTuningLossDO;
|
||||
import cn.iocoder.yudao.module.llm.service.finetuningloss.FineTuningLossService;
|
||||
|
||||
@Tag(name = "管理后台 - 损失记录表,用于记录每次训练的损失值")
|
||||
@RestController
|
||||
@RequestMapping("/llm/fine-tuning-loss")
|
||||
@Validated
|
||||
public class FineTuningLossController {
|
||||
|
||||
@Resource
|
||||
private FineTuningLossService fineTuningLossService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建损失记录表,用于记录每次训练的损失值")
|
||||
@PreAuthorize("@ss.hasPermission('llm:fine-tuning-loss:create')")
|
||||
public CommonResult<Long> createFineTuningLoss(@Valid @RequestBody FineTuningLossSaveReqVO createReqVO) {
|
||||
return success(fineTuningLossService.createFineTuningLoss(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新损失记录表,用于记录每次训练的损失值")
|
||||
@PreAuthorize("@ss.hasPermission('llm:fine-tuning-loss:update')")
|
||||
public CommonResult<Boolean> updateFineTuningLoss(@Valid @RequestBody FineTuningLossSaveReqVO updateReqVO) {
|
||||
fineTuningLossService.updateFineTuningLoss(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除损失记录表,用于记录每次训练的损失值")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('llm:fine-tuning-loss:delete')")
|
||||
public CommonResult<Boolean> deleteFineTuningLoss(@RequestParam("id") Long id) {
|
||||
fineTuningLossService.deleteFineTuningLoss(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得损失记录表,用于记录每次训练的损失值")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('llm:fine-tuning-loss:query')")
|
||||
public CommonResult<FineTuningLossRespVO> getFineTuningLoss(@RequestParam("id") Long id) {
|
||||
FineTuningLossDO fineTuningLoss = fineTuningLossService.getFineTuningLoss(id);
|
||||
return success(BeanUtils.toBean(fineTuningLoss, FineTuningLossRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得损失记录表,用于记录每次训练的损失值分页")
|
||||
@PreAuthorize("@ss.hasPermission('llm:fine-tuning-loss:query')")
|
||||
public CommonResult<PageResult<FineTuningLossRespVO>> getFineTuningLossPage(@Valid FineTuningLossPageReqVO pageReqVO) {
|
||||
PageResult<FineTuningLossDO> pageResult = fineTuningLossService.getFineTuningLossPage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, FineTuningLossRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出损失记录表,用于记录每次训练的损失值 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('llm:fine-tuning-loss:export')")
|
||||
@ApiAccessLog(operateType = EXPORT)
|
||||
public void exportFineTuningLossExcel(@Valid FineTuningLossPageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<FineTuningLossDO> list = fineTuningLossService.getFineTuningLossPage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "损失记录表,用于记录每次训练的损失值.xls", "数据", FineTuningLossRespVO.class,
|
||||
BeanUtils.toBean(list, FineTuningLossRespVO.class));
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,31 @@
|
||||
package cn.iocoder.yudao.module.llm.controller.admin.finetuningloss.vo;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@Schema(description = "管理后台 - 损失记录表,用于记录每次训练的损失值分页 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class FineTuningLossPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
@Schema(description = "微调任务ID", example = "16806")
|
||||
private Long taskId;
|
||||
|
||||
@Schema(description = "训练轮数")
|
||||
private Integer epoch;
|
||||
|
||||
@Schema(description = "损失值")
|
||||
private Double lossValue;
|
||||
|
||||
}
|
@ -0,0 +1,35 @@
|
||||
package cn.iocoder.yudao.module.llm.controller.admin.finetuningloss.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
import com.alibaba.excel.annotation.*;
|
||||
|
||||
@Schema(description = "管理后台 - 损失记录表,用于记录每次训练的损失值 Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class FineTuningLossRespVO {
|
||||
|
||||
@Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "29379")
|
||||
@ExcelProperty("ID")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@Schema(description = "微调任务ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "16806")
|
||||
@ExcelProperty("微调任务ID")
|
||||
private Long taskId;
|
||||
|
||||
@Schema(description = "训练轮数")
|
||||
@ExcelProperty("训练轮数")
|
||||
private Integer epoch;
|
||||
|
||||
@Schema(description = "损失值")
|
||||
@ExcelProperty("损失值")
|
||||
private Double lossValue;
|
||||
|
||||
}
|
@ -0,0 +1,25 @@
|
||||
package cn.iocoder.yudao.module.llm.controller.admin.finetuningloss.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
@Schema(description = "管理后台 - 损失记录表,用于记录每次训练的损失值新增/修改 Request VO")
|
||||
@Data
|
||||
public class FineTuningLossSaveReqVO {
|
||||
|
||||
@Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "29379")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "微调任务ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "16806")
|
||||
@NotNull(message = "微调任务ID不能为空")
|
||||
private Long taskId;
|
||||
|
||||
@Schema(description = "训练轮数")
|
||||
private Integer epoch;
|
||||
|
||||
@Schema(description = "损失值")
|
||||
private Double lossValue;
|
||||
|
||||
}
|
@ -0,0 +1,95 @@
|
||||
package cn.iocoder.yudao.module.llm.controller.admin.prompttemplates;
|
||||
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import javax.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
|
||||
import javax.validation.constraints.*;
|
||||
import javax.validation.*;
|
||||
import javax.servlet.http.*;
|
||||
import java.util.*;
|
||||
import java.io.IOException;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
||||
|
||||
import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog;
|
||||
import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.*;
|
||||
|
||||
import cn.iocoder.yudao.module.llm.controller.admin.prompttemplates.vo.*;
|
||||
import cn.iocoder.yudao.module.llm.dal.dataobject.prompttemplates.PromptTemplatesDO;
|
||||
import cn.iocoder.yudao.module.llm.service.prompttemplates.PromptTemplatesService;
|
||||
|
||||
@Tag(name = "管理后台 - Prompt 模板表,用于记录每个模板的信息")
|
||||
@RestController
|
||||
@RequestMapping("/llm/prompt-templates")
|
||||
@Validated
|
||||
public class PromptTemplatesController {
|
||||
|
||||
@Resource
|
||||
private PromptTemplatesService promptTemplatesService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建Prompt 模板表,用于记录每个模板的信息")
|
||||
@PreAuthorize("@ss.hasPermission('llm:prompt-templates:create')")
|
||||
public CommonResult<Long> createPromptTemplates(@Valid @RequestBody PromptTemplatesSaveReqVO createReqVO) {
|
||||
return success(promptTemplatesService.createPromptTemplates(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新Prompt 模板表,用于记录每个模板的信息")
|
||||
@PreAuthorize("@ss.hasPermission('llm:prompt-templates:update')")
|
||||
public CommonResult<Boolean> updatePromptTemplates(@Valid @RequestBody PromptTemplatesSaveReqVO updateReqVO) {
|
||||
promptTemplatesService.updatePromptTemplates(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除Prompt 模板表,用于记录每个模板的信息")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('llm:prompt-templates:delete')")
|
||||
public CommonResult<Boolean> deletePromptTemplates(@RequestParam("id") Long id) {
|
||||
promptTemplatesService.deletePromptTemplates(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得Prompt 模板表,用于记录每个模板的信息")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('llm:prompt-templates:query')")
|
||||
public CommonResult<PromptTemplatesRespVO> getPromptTemplates(@RequestParam("id") Long id) {
|
||||
PromptTemplatesDO promptTemplates = promptTemplatesService.getPromptTemplates(id);
|
||||
return success(BeanUtils.toBean(promptTemplates, PromptTemplatesRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得Prompt 模板表,用于记录每个模板的信息分页")
|
||||
@PreAuthorize("@ss.hasPermission('llm:prompt-templates:query')")
|
||||
public CommonResult<PageResult<PromptTemplatesRespVO>> getPromptTemplatesPage(@Valid PromptTemplatesPageReqVO pageReqVO) {
|
||||
PageResult<PromptTemplatesDO> pageResult = promptTemplatesService.getPromptTemplatesPage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, PromptTemplatesRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出Prompt 模板表,用于记录每个模板的信息 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('llm:prompt-templates:export')")
|
||||
@ApiAccessLog(operateType = EXPORT)
|
||||
public void exportPromptTemplatesExcel(@Valid PromptTemplatesPageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<PromptTemplatesDO> list = promptTemplatesService.getPromptTemplatesPage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "Prompt 模板表,用于记录每个模板的信息.xls", "数据", PromptTemplatesRespVO.class,
|
||||
BeanUtils.toBean(list, PromptTemplatesRespVO.class));
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,40 @@
|
||||
package cn.iocoder.yudao.module.llm.controller.admin.prompttemplates.vo;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@Schema(description = "管理后台 - Prompt 模板表,用于记录每个模板的信息分页 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class PromptTemplatesPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "Prompt 模板名称", example = "王五")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "模板分类,使用字典(llm_prompt_template_category)")
|
||||
private Integer templateCategory;
|
||||
|
||||
@Schema(description = "模板框架,使用字典(llm_prompt_template_framework)")
|
||||
private Integer templateFramework;
|
||||
|
||||
@Schema(description = "模板内容")
|
||||
private String templateText;
|
||||
|
||||
@Schema(description = "变量标识符,使用字典(llm_variable_identifier)")
|
||||
private Integer variableIdentifier;
|
||||
|
||||
@Schema(description = "模板类型(1 - 预制模板、2 - 自定义模板)", example = "1")
|
||||
private Integer templateType;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
}
|
@ -0,0 +1,47 @@
|
||||
package cn.iocoder.yudao.module.llm.controller.admin.prompttemplates.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
import com.alibaba.excel.annotation.*;
|
||||
|
||||
@Schema(description = "管理后台 - Prompt 模板表,用于记录每个模板的信息 Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class PromptTemplatesRespVO {
|
||||
|
||||
@Schema(description = "Prompt 模板ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "20922")
|
||||
@ExcelProperty("Prompt 模板ID")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "Prompt 模板名称", example = "王五")
|
||||
@ExcelProperty("Prompt 模板名称")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "模板分类,使用字典(llm_prompt_template_category)")
|
||||
@ExcelProperty("模板分类,使用字典(llm_prompt_template_category)")
|
||||
private Integer templateCategory;
|
||||
|
||||
@Schema(description = "模板框架,使用字典(llm_prompt_template_framework)")
|
||||
@ExcelProperty("模板框架,使用字典(llm_prompt_template_framework)")
|
||||
private Integer templateFramework;
|
||||
|
||||
@Schema(description = "模板内容")
|
||||
@ExcelProperty("模板内容")
|
||||
private String templateText;
|
||||
|
||||
@Schema(description = "变量标识符,使用字典(llm_variable_identifier)")
|
||||
@ExcelProperty("变量标识符,使用字典(llm_variable_identifier)")
|
||||
private Integer variableIdentifier;
|
||||
|
||||
@Schema(description = "模板类型(1 - 预制模板、2 - 自定义模板)", example = "1")
|
||||
@ExcelProperty("模板类型(1 - 预制模板、2 - 自定义模板)")
|
||||
private Integer templateType;
|
||||
|
||||
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
}
|
@ -0,0 +1,33 @@
|
||||
package cn.iocoder.yudao.module.llm.controller.admin.prompttemplates.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
@Schema(description = "管理后台 - Prompt 模板表,用于记录每个模板的信息新增/修改 Request VO")
|
||||
@Data
|
||||
public class PromptTemplatesSaveReqVO {
|
||||
|
||||
@Schema(description = "Prompt 模板ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "20922")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "Prompt 模板名称", example = "王五")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "模板分类,使用字典(llm_prompt_template_category)")
|
||||
private Integer templateCategory;
|
||||
|
||||
@Schema(description = "模板框架,使用字典(llm_prompt_template_framework)")
|
||||
private Integer templateFramework;
|
||||
|
||||
@Schema(description = "模板内容")
|
||||
private String templateText;
|
||||
|
||||
@Schema(description = "变量标识符,使用字典(llm_variable_identifier)")
|
||||
private Integer variableIdentifier;
|
||||
|
||||
@Schema(description = "模板类型(1 - 预制模板、2 - 自定义模板)", example = "1")
|
||||
private Integer templateType;
|
||||
|
||||
}
|
@ -0,0 +1,95 @@
|
||||
package cn.iocoder.yudao.module.llm.controller.admin.prompttemplatesapplications;
|
||||
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import javax.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
|
||||
import javax.validation.constraints.*;
|
||||
import javax.validation.*;
|
||||
import javax.servlet.http.*;
|
||||
import java.util.*;
|
||||
import java.io.IOException;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
||||
|
||||
import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog;
|
||||
import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.*;
|
||||
|
||||
import cn.iocoder.yudao.module.llm.controller.admin.prompttemplatesapplications.vo.*;
|
||||
import cn.iocoder.yudao.module.llm.dal.dataobject.prompttemplatesapplications.PromptTemplatesApplicationsDO;
|
||||
import cn.iocoder.yudao.module.llm.service.prompttemplatesapplications.PromptTemplatesApplicationsService;
|
||||
|
||||
@Tag(name = "管理后台 - Prompt 模板 应用关系表,记录模板和应用之间的多对多关系")
|
||||
@RestController
|
||||
@RequestMapping("/llm/prompt-templates-applications")
|
||||
@Validated
|
||||
public class PromptTemplatesApplicationsController {
|
||||
|
||||
@Resource
|
||||
private PromptTemplatesApplicationsService promptTemplatesApplicationsService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建Prompt 模板 应用关系表,记录模板和应用之间的多对多关系")
|
||||
@PreAuthorize("@ss.hasPermission('llm:prompt-templates-applications:create')")
|
||||
public CommonResult<Long> createPromptTemplatesApplications(@Valid @RequestBody PromptTemplatesApplicationsSaveReqVO createReqVO) {
|
||||
return success(promptTemplatesApplicationsService.createPromptTemplatesApplications(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新Prompt 模板 应用关系表,记录模板和应用之间的多对多关系")
|
||||
@PreAuthorize("@ss.hasPermission('llm:prompt-templates-applications:update')")
|
||||
public CommonResult<Boolean> updatePromptTemplatesApplications(@Valid @RequestBody PromptTemplatesApplicationsSaveReqVO updateReqVO) {
|
||||
promptTemplatesApplicationsService.updatePromptTemplatesApplications(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除Prompt 模板 应用关系表,记录模板和应用之间的多对多关系")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('llm:prompt-templates-applications:delete')")
|
||||
public CommonResult<Boolean> deletePromptTemplatesApplications(@RequestParam("id") Long id) {
|
||||
promptTemplatesApplicationsService.deletePromptTemplatesApplications(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得Prompt 模板 应用关系表,记录模板和应用之间的多对多关系")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('llm:prompt-templates-applications:query')")
|
||||
public CommonResult<PromptTemplatesApplicationsRespVO> getPromptTemplatesApplications(@RequestParam("id") Long id) {
|
||||
PromptTemplatesApplicationsDO promptTemplatesApplications = promptTemplatesApplicationsService.getPromptTemplatesApplications(id);
|
||||
return success(BeanUtils.toBean(promptTemplatesApplications, PromptTemplatesApplicationsRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得Prompt 模板 应用关系表,记录模板和应用之间的多对多关系分页")
|
||||
@PreAuthorize("@ss.hasPermission('llm:prompt-templates-applications:query')")
|
||||
public CommonResult<PageResult<PromptTemplatesApplicationsRespVO>> getPromptTemplatesApplicationsPage(@Valid PromptTemplatesApplicationsPageReqVO pageReqVO) {
|
||||
PageResult<PromptTemplatesApplicationsDO> pageResult = promptTemplatesApplicationsService.getPromptTemplatesApplicationsPage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, PromptTemplatesApplicationsRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出Prompt 模板 应用关系表,记录模板和应用之间的多对多关系 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('llm:prompt-templates-applications:export')")
|
||||
@ApiAccessLog(operateType = EXPORT)
|
||||
public void exportPromptTemplatesApplicationsExcel(@Valid PromptTemplatesApplicationsPageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<PromptTemplatesApplicationsDO> list = promptTemplatesApplicationsService.getPromptTemplatesApplicationsPage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "Prompt 模板 应用关系表,记录模板和应用之间的多对多关系.xls", "数据", PromptTemplatesApplicationsRespVO.class,
|
||||
BeanUtils.toBean(list, PromptTemplatesApplicationsRespVO.class));
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,28 @@
|
||||
package cn.iocoder.yudao.module.llm.controller.admin.prompttemplatesapplications.vo;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@Schema(description = "管理后台 - Prompt 模板 应用关系表,记录模板和应用之间的多对多关系分页 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class PromptTemplatesApplicationsPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "Prompt 模板ID", example = "5359")
|
||||
private Long promptTemplateId;
|
||||
|
||||
@Schema(description = "应用ID", example = "32098")
|
||||
private Long applicationId;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
}
|
@ -0,0 +1,31 @@
|
||||
package cn.iocoder.yudao.module.llm.controller.admin.prompttemplatesapplications.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
import com.alibaba.excel.annotation.*;
|
||||
|
||||
@Schema(description = "管理后台 - Prompt 模板 应用关系表,记录模板和应用之间的多对多关系 Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class PromptTemplatesApplicationsRespVO {
|
||||
|
||||
@Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "16475")
|
||||
@ExcelProperty("ID")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "Prompt 模板ID", example = "5359")
|
||||
@ExcelProperty("Prompt 模板ID")
|
||||
private Long promptTemplateId;
|
||||
|
||||
@Schema(description = "应用ID", example = "32098")
|
||||
@ExcelProperty("应用ID")
|
||||
private Long applicationId;
|
||||
|
||||
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
}
|
@ -0,0 +1,21 @@
|
||||
package cn.iocoder.yudao.module.llm.controller.admin.prompttemplatesapplications.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
@Schema(description = "管理后台 - Prompt 模板 应用关系表,记录模板和应用之间的多对多关系新增/修改 Request VO")
|
||||
@Data
|
||||
public class PromptTemplatesApplicationsSaveReqVO {
|
||||
|
||||
@Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "16475")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "Prompt 模板ID", example = "5359")
|
||||
private Long promptTemplateId;
|
||||
|
||||
@Schema(description = "应用ID", example = "32098")
|
||||
private Long applicationId;
|
||||
|
||||
}
|
@ -0,0 +1,95 @@
|
||||
package cn.iocoder.yudao.module.llm.controller.admin.prompttemplatestags;
|
||||
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import javax.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
|
||||
import javax.validation.constraints.*;
|
||||
import javax.validation.*;
|
||||
import javax.servlet.http.*;
|
||||
import java.util.*;
|
||||
import java.io.IOException;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
||||
|
||||
import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog;
|
||||
import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.*;
|
||||
|
||||
import cn.iocoder.yudao.module.llm.controller.admin.prompttemplatestags.vo.*;
|
||||
import cn.iocoder.yudao.module.llm.dal.dataobject.prompttemplatestags.PromptTemplatesTagsDO;
|
||||
import cn.iocoder.yudao.module.llm.service.prompttemplatestags.PromptTemplatesTagsService;
|
||||
|
||||
@Tag(name = "管理后台 - Prompt 模板标签关系表,记录模板和标签之间的多对多关系")
|
||||
@RestController
|
||||
@RequestMapping("/llm/prompt-templates-tags")
|
||||
@Validated
|
||||
public class PromptTemplatesTagsController {
|
||||
|
||||
@Resource
|
||||
private PromptTemplatesTagsService promptTemplatesTagsService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建Prompt 模板标签关系表,记录模板和标签之间的多对多关系")
|
||||
@PreAuthorize("@ss.hasPermission('llm:prompt-templates-tags:create')")
|
||||
public CommonResult<Long> createPromptTemplatesTags(@Valid @RequestBody PromptTemplatesTagsSaveReqVO createReqVO) {
|
||||
return success(promptTemplatesTagsService.createPromptTemplatesTags(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新Prompt 模板标签关系表,记录模板和标签之间的多对多关系")
|
||||
@PreAuthorize("@ss.hasPermission('llm:prompt-templates-tags:update')")
|
||||
public CommonResult<Boolean> updatePromptTemplatesTags(@Valid @RequestBody PromptTemplatesTagsSaveReqVO updateReqVO) {
|
||||
promptTemplatesTagsService.updatePromptTemplatesTags(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除Prompt 模板标签关系表,记录模板和标签之间的多对多关系")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('llm:prompt-templates-tags:delete')")
|
||||
public CommonResult<Boolean> deletePromptTemplatesTags(@RequestParam("id") Long id) {
|
||||
promptTemplatesTagsService.deletePromptTemplatesTags(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得Prompt 模板标签关系表,记录模板和标签之间的多对多关系")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('llm:prompt-templates-tags:query')")
|
||||
public CommonResult<PromptTemplatesTagsRespVO> getPromptTemplatesTags(@RequestParam("id") Long id) {
|
||||
PromptTemplatesTagsDO promptTemplatesTags = promptTemplatesTagsService.getPromptTemplatesTags(id);
|
||||
return success(BeanUtils.toBean(promptTemplatesTags, PromptTemplatesTagsRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得Prompt 模板标签关系表,记录模板和标签之间的多对多关系分页")
|
||||
@PreAuthorize("@ss.hasPermission('llm:prompt-templates-tags:query')")
|
||||
public CommonResult<PageResult<PromptTemplatesTagsRespVO>> getPromptTemplatesTagsPage(@Valid PromptTemplatesTagsPageReqVO pageReqVO) {
|
||||
PageResult<PromptTemplatesTagsDO> pageResult = promptTemplatesTagsService.getPromptTemplatesTagsPage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, PromptTemplatesTagsRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出Prompt 模板标签关系表,记录模板和标签之间的多对多关系 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('llm:prompt-templates-tags:export')")
|
||||
@ApiAccessLog(operateType = EXPORT)
|
||||
public void exportPromptTemplatesTagsExcel(@Valid PromptTemplatesTagsPageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<PromptTemplatesTagsDO> list = promptTemplatesTagsService.getPromptTemplatesTagsPage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "Prompt 模板标签关系表,记录模板和标签之间的多对多关系.xls", "数据", PromptTemplatesTagsRespVO.class,
|
||||
BeanUtils.toBean(list, PromptTemplatesTagsRespVO.class));
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,28 @@
|
||||
package cn.iocoder.yudao.module.llm.controller.admin.prompttemplatestags.vo;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@Schema(description = "管理后台 - Prompt 模板标签关系表,记录模板和标签之间的多对多关系分页 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class PromptTemplatesTagsPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "Prompt 模板ID", example = "25001")
|
||||
private Long promptTemplateId;
|
||||
|
||||
@Schema(description = "标签ID", example = "23560")
|
||||
private Long tagId;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
}
|
@ -0,0 +1,31 @@
|
||||
package cn.iocoder.yudao.module.llm.controller.admin.prompttemplatestags.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
import com.alibaba.excel.annotation.*;
|
||||
|
||||
@Schema(description = "管理后台 - Prompt 模板标签关系表,记录模板和标签之间的多对多关系 Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class PromptTemplatesTagsRespVO {
|
||||
|
||||
@Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "2237")
|
||||
@ExcelProperty("ID")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "Prompt 模板ID", example = "25001")
|
||||
@ExcelProperty("Prompt 模板ID")
|
||||
private Long promptTemplateId;
|
||||
|
||||
@Schema(description = "标签ID", example = "23560")
|
||||
@ExcelProperty("标签ID")
|
||||
private Long tagId;
|
||||
|
||||
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
}
|
@ -0,0 +1,21 @@
|
||||
package cn.iocoder.yudao.module.llm.controller.admin.prompttemplatestags.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
@Schema(description = "管理后台 - Prompt 模板标签关系表,记录模板和标签之间的多对多关系新增/修改 Request VO")
|
||||
@Data
|
||||
public class PromptTemplatesTagsSaveReqVO {
|
||||
|
||||
@Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "2237")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "Prompt 模板ID", example = "25001")
|
||||
private Long promptTemplateId;
|
||||
|
||||
@Schema(description = "标签ID", example = "23560")
|
||||
private Long tagId;
|
||||
|
||||
}
|
@ -61,14 +61,10 @@ public class ApplicationDO extends BaseDO {
|
||||
* 单次回复限制
|
||||
*/
|
||||
private Integer maxTokens;
|
||||
/**
|
||||
* 系统Prompt
|
||||
*/
|
||||
private String prompt;
|
||||
/**
|
||||
* 向量知识库,知识库ID
|
||||
*/
|
||||
private Long retrievalAugmentedGeneration;
|
||||
private Long modelServiceId;
|
||||
/**
|
||||
* 应用API地址
|
||||
*/
|
||||
@ -81,5 +77,13 @@ public class ApplicationDO extends BaseDO {
|
||||
* 聊天人次
|
||||
*/
|
||||
private Long chatCount;
|
||||
/**
|
||||
* 大模型服务的推理参数,以JSON格式存储
|
||||
*/
|
||||
private String modelParams;
|
||||
/**
|
||||
* 系统Prompt
|
||||
*/
|
||||
private String prompt;
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,59 @@
|
||||
package cn.iocoder.yudao.module.llm.dal.dataobject.basemodel;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalDateTime;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
|
||||
|
||||
/**
|
||||
* 基座模型 DO
|
||||
*
|
||||
* @author 华大大模型
|
||||
*/
|
||||
@TableName("llm_base_model")
|
||||
@KeySequence("llm_base_model_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class BaseModelDO extends BaseDO {
|
||||
|
||||
/**
|
||||
* 基座模型唯一标识
|
||||
*/
|
||||
@TableId
|
||||
private Integer id;
|
||||
/**
|
||||
* 基座模型名称
|
||||
*/
|
||||
private String modelName;
|
||||
/**
|
||||
* 参数量
|
||||
*/
|
||||
private Integer parameterCount;
|
||||
/**
|
||||
* 最大上下文长度
|
||||
*/
|
||||
private Integer maxContextLength;
|
||||
/**
|
||||
* 模型类型
|
||||
*/
|
||||
private String modelType;
|
||||
/**
|
||||
* 是否启动
|
||||
*/
|
||||
private Boolean isActive;
|
||||
/**
|
||||
* 是否微调
|
||||
*/
|
||||
private Boolean isFinetuned;
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String notes;
|
||||
|
||||
}
|
@ -0,0 +1,59 @@
|
||||
package cn.iocoder.yudao.module.llm.dal.dataobject.conversation;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalDateTime;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
|
||||
|
||||
/**
|
||||
* 大模型对话记录 DO
|
||||
*
|
||||
* @author 华大大模型
|
||||
*/
|
||||
@TableName("llm_conversation")
|
||||
@KeySequence("llm_conversation_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class ConversationDO extends BaseDO {
|
||||
|
||||
/**
|
||||
* 对话记录的唯一标识
|
||||
*/
|
||||
@TableId
|
||||
private Integer id;
|
||||
/**
|
||||
* 对话中的角色: user, assistant, system
|
||||
*/
|
||||
private String role;
|
||||
/**
|
||||
* 对话的内容
|
||||
*/
|
||||
private String content;
|
||||
/**
|
||||
* 推理参数,采用 JSON 格式
|
||||
*/
|
||||
private String modelParams;
|
||||
/**
|
||||
* 提示词
|
||||
*/
|
||||
private String prompt;
|
||||
/**
|
||||
* 知识库相关信息
|
||||
*/
|
||||
private String knowledgeBaseId;
|
||||
/**
|
||||
* 应用ID
|
||||
*/
|
||||
private Long applicationId;
|
||||
/**
|
||||
* 模型服务ID
|
||||
*/
|
||||
private Long modelServiceId;
|
||||
|
||||
}
|
@ -0,0 +1,51 @@
|
||||
package cn.iocoder.yudao.module.llm.dal.dataobject.dataprocesstask;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalDateTime;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
|
||||
|
||||
/**
|
||||
* 数据处理任务 DO
|
||||
*
|
||||
* @author 华大大模型
|
||||
*/
|
||||
@TableName("llm_data_process_task")
|
||||
@KeySequence("llm_data_process_task_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class DataProcessTaskDO extends BaseDO {
|
||||
|
||||
/**
|
||||
* 数据处理任务ID
|
||||
*/
|
||||
@TableId
|
||||
private Long id;
|
||||
/**
|
||||
* 任务名称
|
||||
*/
|
||||
private String taskName;
|
||||
/**
|
||||
* 处理前数据集ID
|
||||
*/
|
||||
private Long datasetId;
|
||||
/**
|
||||
* 状态,使用字典(llm_data_process_status)
|
||||
*/
|
||||
private Integer status;
|
||||
/**
|
||||
* 处理后的数据集ID
|
||||
*/
|
||||
private Long datasetPostId;
|
||||
/**
|
||||
* 配置信息
|
||||
*/
|
||||
private String options;
|
||||
|
||||
}
|
@ -0,0 +1,47 @@
|
||||
package cn.iocoder.yudao.module.llm.dal.dataobject.datasetanswer;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalDateTime;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
|
||||
|
||||
/**
|
||||
* 数据集数据问题标注内容 DO
|
||||
*
|
||||
* @author 华大大模型
|
||||
*/
|
||||
@TableName("llm_dataset_answer")
|
||||
@KeySequence("llm_dataset_answer_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class DatasetAnswerDO extends BaseDO {
|
||||
|
||||
/**
|
||||
* 数据集问题ID
|
||||
*/
|
||||
@TableId
|
||||
private Long id;
|
||||
/**
|
||||
* 数据集ID
|
||||
*/
|
||||
private Long datasetId;
|
||||
/**
|
||||
* 数据文件ID
|
||||
*/
|
||||
private Long datasetFilesId;
|
||||
/**
|
||||
* 问题ID
|
||||
*/
|
||||
private Long questionId;
|
||||
/**
|
||||
* 标注内容
|
||||
*/
|
||||
private String answer;
|
||||
|
||||
}
|
@ -0,0 +1,47 @@
|
||||
package cn.iocoder.yudao.module.llm.dal.dataobject.datasetfiles;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalDateTime;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
|
||||
|
||||
/**
|
||||
* 数据集数据文件 DO
|
||||
*
|
||||
* @author 华大大模型
|
||||
*/
|
||||
@TableName("llm_dataset_files")
|
||||
@KeySequence("llm_dataset_files_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class DatasetFilesDO extends BaseDO {
|
||||
|
||||
/**
|
||||
* 数据集ID
|
||||
*/
|
||||
@TableId
|
||||
private Long id;
|
||||
/**
|
||||
* 数据集ID
|
||||
*/
|
||||
private Long datasetId;
|
||||
/**
|
||||
* 数据长度
|
||||
*/
|
||||
private Long dataLength;
|
||||
/**
|
||||
* 数据文件(文件表的ID)
|
||||
*/
|
||||
private Long datasetFile;
|
||||
/**
|
||||
* 文件URL地址
|
||||
*/
|
||||
private String datasetFileUrl;
|
||||
|
||||
}
|
@ -0,0 +1,47 @@
|
||||
package cn.iocoder.yudao.module.llm.dal.dataobject.datasetquestion;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalDateTime;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
|
||||
|
||||
/**
|
||||
* 数据集数据问题 DO
|
||||
*
|
||||
* @author 华大大模型
|
||||
*/
|
||||
@TableName("llm_dataset_question")
|
||||
@KeySequence("llm_dataset_question_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class DatasetQuestionDO extends BaseDO {
|
||||
|
||||
/**
|
||||
* 数据集问题ID
|
||||
*/
|
||||
@TableId
|
||||
private Long id;
|
||||
/**
|
||||
* 数据集ID
|
||||
*/
|
||||
private Long datasetId;
|
||||
/**
|
||||
* 数据文件ID
|
||||
*/
|
||||
private Long datasetFilesId;
|
||||
/**
|
||||
* 问题内容
|
||||
*/
|
||||
private String question;
|
||||
/**
|
||||
* 标注状态,使用字典(llm_dataset_mark_status)
|
||||
*/
|
||||
private Integer status;
|
||||
|
||||
}
|
@ -0,0 +1,56 @@
|
||||
package cn.iocoder.yudao.module.llm.dal.dataobject.finetuning;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalDateTime;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
|
||||
|
||||
/**
|
||||
* 模型微调 DO
|
||||
*
|
||||
* @author 华大大模型
|
||||
*/
|
||||
@TableName("llm_fine_tuning")
|
||||
@KeySequence("llm_fine_tuning_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class FineTuningDO extends BaseDO {
|
||||
|
||||
/**
|
||||
* 微调记录唯一标识
|
||||
*/
|
||||
@TableId
|
||||
private Integer id;
|
||||
/**
|
||||
* 关联的基座模型ID
|
||||
*/
|
||||
private Integer baseModelId;
|
||||
/**
|
||||
* 训练数据量
|
||||
*/
|
||||
private Integer trainingDataSize;
|
||||
/**
|
||||
* 评估数据集
|
||||
*/
|
||||
private String evaluationDataset;
|
||||
/**
|
||||
* 平均分
|
||||
*/
|
||||
private BigDecimal averageScore;
|
||||
/**
|
||||
* 评估状态
|
||||
*/
|
||||
private String evaluationStatus;
|
||||
/**
|
||||
* lora路径
|
||||
*/
|
||||
private String loraPath;
|
||||
|
||||
}
|
@ -0,0 +1,43 @@
|
||||
package cn.iocoder.yudao.module.llm.dal.dataobject.finetuningloss;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalDateTime;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
|
||||
|
||||
/**
|
||||
* 损失记录表,用于记录每次训练的损失值 DO
|
||||
*
|
||||
* @author 华大大模型
|
||||
*/
|
||||
@TableName("llm_fine_tuning_loss")
|
||||
@KeySequence("llm_fine_tuning_loss_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class FineTuningLossDO extends BaseDO {
|
||||
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
@TableId
|
||||
private Long id;
|
||||
/**
|
||||
* 微调任务ID
|
||||
*/
|
||||
private Long taskId;
|
||||
/**
|
||||
* 训练轮数
|
||||
*/
|
||||
private Integer epoch;
|
||||
/**
|
||||
* 损失值
|
||||
*/
|
||||
private Double lossValue;
|
||||
|
||||
}
|
@ -0,0 +1,55 @@
|
||||
package cn.iocoder.yudao.module.llm.dal.dataobject.prompttemplates;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalDateTime;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
|
||||
|
||||
/**
|
||||
* Prompt 模板表,用于记录每个模板的信息 DO
|
||||
*
|
||||
* @author 华大大模型
|
||||
*/
|
||||
@TableName("llm_prompt_templates")
|
||||
@KeySequence("llm_prompt_templates_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class PromptTemplatesDO extends BaseDO {
|
||||
|
||||
/**
|
||||
* Prompt 模板ID
|
||||
*/
|
||||
@TableId
|
||||
private Long id;
|
||||
/**
|
||||
* Prompt 模板名称
|
||||
*/
|
||||
private String name;
|
||||
/**
|
||||
* 模板分类,使用字典(llm_prompt_template_category)
|
||||
*/
|
||||
private Integer templateCategory;
|
||||
/**
|
||||
* 模板框架,使用字典(llm_prompt_template_framework)
|
||||
*/
|
||||
private Integer templateFramework;
|
||||
/**
|
||||
* 模板内容
|
||||
*/
|
||||
private String templateText;
|
||||
/**
|
||||
* 变量标识符,使用字典(llm_variable_identifier)
|
||||
*/
|
||||
private Integer variableIdentifier;
|
||||
/**
|
||||
* 模板类型(1 - 预制模板、2 - 自定义模板)
|
||||
*/
|
||||
private Integer templateType;
|
||||
|
||||
}
|
@ -0,0 +1,39 @@
|
||||
package cn.iocoder.yudao.module.llm.dal.dataobject.prompttemplatesapplications;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalDateTime;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
|
||||
|
||||
/**
|
||||
* Prompt 模板 应用关系表,记录模板和应用之间的多对多关系 DO
|
||||
*
|
||||
* @author 华大大模型
|
||||
*/
|
||||
@TableName("llm_prompt_templates_applications")
|
||||
@KeySequence("llm_prompt_templates_applications_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class PromptTemplatesApplicationsDO extends BaseDO {
|
||||
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
@TableId
|
||||
private Long id;
|
||||
/**
|
||||
* Prompt 模板ID
|
||||
*/
|
||||
private Long promptTemplateId;
|
||||
/**
|
||||
* 应用ID
|
||||
*/
|
||||
private Long applicationId;
|
||||
|
||||
}
|
@ -0,0 +1,39 @@
|
||||
package cn.iocoder.yudao.module.llm.dal.dataobject.prompttemplatestags;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalDateTime;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
|
||||
|
||||
/**
|
||||
* Prompt 模板标签关系表,记录模板和标签之间的多对多关系 DO
|
||||
*
|
||||
* @author 华大大模型
|
||||
*/
|
||||
@TableName("llm_prompt_templates_tags")
|
||||
@KeySequence("llm_prompt_templates_tags_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class PromptTemplatesTagsDO extends BaseDO {
|
||||
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
@TableId
|
||||
private Long id;
|
||||
/**
|
||||
* Prompt 模板ID
|
||||
*/
|
||||
private Long promptTemplateId;
|
||||
/**
|
||||
* 标签ID
|
||||
*/
|
||||
private Long tagId;
|
||||
|
||||
}
|
@ -0,0 +1,33 @@
|
||||
package cn.iocoder.yudao.module.llm.dal.mysql.basemodel;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import cn.iocoder.yudao.module.llm.dal.dataobject.basemodel.BaseModelDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import cn.iocoder.yudao.module.llm.controller.admin.basemodel.vo.*;
|
||||
|
||||
/**
|
||||
* 基座模型 Mapper
|
||||
*
|
||||
* @author 华大大模型
|
||||
*/
|
||||
@Mapper
|
||||
public interface BaseModelMapper extends BaseMapperX<BaseModelDO> {
|
||||
|
||||
default PageResult<BaseModelDO> selectPage(BaseModelPageReqVO reqVO) {
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<BaseModelDO>()
|
||||
.likeIfPresent(BaseModelDO::getModelName, reqVO.getModelName())
|
||||
.eqIfPresent(BaseModelDO::getParameterCount, reqVO.getParameterCount())
|
||||
.eqIfPresent(BaseModelDO::getMaxContextLength, reqVO.getMaxContextLength())
|
||||
.eqIfPresent(BaseModelDO::getModelType, reqVO.getModelType())
|
||||
.eqIfPresent(BaseModelDO::getIsActive, reqVO.getIsActive())
|
||||
.eqIfPresent(BaseModelDO::getIsFinetuned, reqVO.getIsFinetuned())
|
||||
.eqIfPresent(BaseModelDO::getNotes, reqVO.getNotes())
|
||||
.betweenIfPresent(BaseModelDO::getCreateTime, reqVO.getCreateTime())
|
||||
.orderByDesc(BaseModelDO::getId));
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,33 @@
|
||||
package cn.iocoder.yudao.module.llm.dal.mysql.conversation;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import cn.iocoder.yudao.module.llm.dal.dataobject.conversation.ConversationDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import cn.iocoder.yudao.module.llm.controller.admin.conversation.vo.*;
|
||||
|
||||
/**
|
||||
* 大模型对话记录 Mapper
|
||||
*
|
||||
* @author 华大大模型
|
||||
*/
|
||||
@Mapper
|
||||
public interface ConversationMapper extends BaseMapperX<ConversationDO> {
|
||||
|
||||
default PageResult<ConversationDO> selectPage(ConversationPageReqVO reqVO) {
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<ConversationDO>()
|
||||
.eqIfPresent(ConversationDO::getRole, reqVO.getRole())
|
||||
.eqIfPresent(ConversationDO::getContent, reqVO.getContent())
|
||||
.eqIfPresent(ConversationDO::getModelParams, reqVO.getModelParams())
|
||||
.eqIfPresent(ConversationDO::getPrompt, reqVO.getPrompt())
|
||||
.eqIfPresent(ConversationDO::getKnowledgeBaseId, reqVO.getKnowledgeBaseId())
|
||||
.eqIfPresent(ConversationDO::getApplicationId, reqVO.getApplicationId())
|
||||
.eqIfPresent(ConversationDO::getModelServiceId, reqVO.getModelServiceId())
|
||||
.betweenIfPresent(ConversationDO::getCreateTime, reqVO.getCreateTime())
|
||||
.orderByDesc(ConversationDO::getId));
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,31 @@
|
||||
package cn.iocoder.yudao.module.llm.dal.mysql.dataprocesstask;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import cn.iocoder.yudao.module.llm.dal.dataobject.dataprocesstask.DataProcessTaskDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import cn.iocoder.yudao.module.llm.controller.admin.dataprocesstask.vo.*;
|
||||
|
||||
/**
|
||||
* 数据处理任务 Mapper
|
||||
*
|
||||
* @author 华大大模型
|
||||
*/
|
||||
@Mapper
|
||||
public interface DataProcessTaskMapper extends BaseMapperX<DataProcessTaskDO> {
|
||||
|
||||
default PageResult<DataProcessTaskDO> selectPage(DataProcessTaskPageReqVO reqVO) {
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<DataProcessTaskDO>()
|
||||
.likeIfPresent(DataProcessTaskDO::getTaskName, reqVO.getTaskName())
|
||||
.eqIfPresent(DataProcessTaskDO::getDatasetId, reqVO.getDatasetId())
|
||||
.betweenIfPresent(DataProcessTaskDO::getCreateTime, reqVO.getCreateTime())
|
||||
.eqIfPresent(DataProcessTaskDO::getStatus, reqVO.getStatus())
|
||||
.eqIfPresent(DataProcessTaskDO::getDatasetPostId, reqVO.getDatasetPostId())
|
||||
.eqIfPresent(DataProcessTaskDO::getOptions, reqVO.getOptions())
|
||||
.orderByDesc(DataProcessTaskDO::getId));
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,30 @@
|
||||
package cn.iocoder.yudao.module.llm.dal.mysql.datasetanswer;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import cn.iocoder.yudao.module.llm.dal.dataobject.datasetanswer.DatasetAnswerDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import cn.iocoder.yudao.module.llm.controller.admin.datasetanswer.vo.*;
|
||||
|
||||
/**
|
||||
* 数据集数据问题标注内容 Mapper
|
||||
*
|
||||
* @author 华大大模型
|
||||
*/
|
||||
@Mapper
|
||||
public interface DatasetAnswerMapper extends BaseMapperX<DatasetAnswerDO> {
|
||||
|
||||
default PageResult<DatasetAnswerDO> selectPage(DatasetAnswerPageReqVO reqVO) {
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<DatasetAnswerDO>()
|
||||
.eqIfPresent(DatasetAnswerDO::getDatasetId, reqVO.getDatasetId())
|
||||
.eqIfPresent(DatasetAnswerDO::getDatasetFilesId, reqVO.getDatasetFilesId())
|
||||
.eqIfPresent(DatasetAnswerDO::getQuestionId, reqVO.getQuestionId())
|
||||
.eqIfPresent(DatasetAnswerDO::getAnswer, reqVO.getAnswer())
|
||||
.betweenIfPresent(DatasetAnswerDO::getCreateTime, reqVO.getCreateTime())
|
||||
.orderByDesc(DatasetAnswerDO::getId));
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,30 @@
|
||||
package cn.iocoder.yudao.module.llm.dal.mysql.datasetfiles;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import cn.iocoder.yudao.module.llm.dal.dataobject.datasetfiles.DatasetFilesDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import cn.iocoder.yudao.module.llm.controller.admin.datasetfiles.vo.*;
|
||||
|
||||
/**
|
||||
* 数据集数据文件 Mapper
|
||||
*
|
||||
* @author 华大大模型
|
||||
*/
|
||||
@Mapper
|
||||
public interface DatasetFilesMapper extends BaseMapperX<DatasetFilesDO> {
|
||||
|
||||
default PageResult<DatasetFilesDO> selectPage(DatasetFilesPageReqVO reqVO) {
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<DatasetFilesDO>()
|
||||
.eqIfPresent(DatasetFilesDO::getDatasetId, reqVO.getDatasetId())
|
||||
.eqIfPresent(DatasetFilesDO::getDataLength, reqVO.getDataLength())
|
||||
.eqIfPresent(DatasetFilesDO::getDatasetFile, reqVO.getDatasetFile())
|
||||
.eqIfPresent(DatasetFilesDO::getDatasetFileUrl, reqVO.getDatasetFileUrl())
|
||||
.betweenIfPresent(DatasetFilesDO::getCreateTime, reqVO.getCreateTime())
|
||||
.orderByDesc(DatasetFilesDO::getId));
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,30 @@
|
||||
package cn.iocoder.yudao.module.llm.dal.mysql.datasetquestion;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import cn.iocoder.yudao.module.llm.dal.dataobject.datasetquestion.DatasetQuestionDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import cn.iocoder.yudao.module.llm.controller.admin.datasetquestion.vo.*;
|
||||
|
||||
/**
|
||||
* 数据集数据问题 Mapper
|
||||
*
|
||||
* @author 华大大模型
|
||||
*/
|
||||
@Mapper
|
||||
public interface DatasetQuestionMapper extends BaseMapperX<DatasetQuestionDO> {
|
||||
|
||||
default PageResult<DatasetQuestionDO> selectPage(DatasetQuestionPageReqVO reqVO) {
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<DatasetQuestionDO>()
|
||||
.eqIfPresent(DatasetQuestionDO::getDatasetId, reqVO.getDatasetId())
|
||||
.eqIfPresent(DatasetQuestionDO::getDatasetFilesId, reqVO.getDatasetFilesId())
|
||||
.eqIfPresent(DatasetQuestionDO::getQuestion, reqVO.getQuestion())
|
||||
.eqIfPresent(DatasetQuestionDO::getStatus, reqVO.getStatus())
|
||||
.betweenIfPresent(DatasetQuestionDO::getCreateTime, reqVO.getCreateTime())
|
||||
.orderByDesc(DatasetQuestionDO::getId));
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,32 @@
|
||||
package cn.iocoder.yudao.module.llm.dal.mysql.finetuning;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import cn.iocoder.yudao.module.llm.dal.dataobject.finetuning.FineTuningDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import cn.iocoder.yudao.module.llm.controller.admin.finetuning.vo.*;
|
||||
|
||||
/**
|
||||
* 模型微调 Mapper
|
||||
*
|
||||
* @author 华大大模型
|
||||
*/
|
||||
@Mapper
|
||||
public interface FineTuningMapper extends BaseMapperX<FineTuningDO> {
|
||||
|
||||
default PageResult<FineTuningDO> selectPage(FineTuningPageReqVO reqVO) {
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<FineTuningDO>()
|
||||
.eqIfPresent(FineTuningDO::getBaseModelId, reqVO.getBaseModelId())
|
||||
.eqIfPresent(FineTuningDO::getTrainingDataSize, reqVO.getTrainingDataSize())
|
||||
.eqIfPresent(FineTuningDO::getEvaluationDataset, reqVO.getEvaluationDataset())
|
||||
.eqIfPresent(FineTuningDO::getAverageScore, reqVO.getAverageScore())
|
||||
.eqIfPresent(FineTuningDO::getEvaluationStatus, reqVO.getEvaluationStatus())
|
||||
.eqIfPresent(FineTuningDO::getLoraPath, reqVO.getLoraPath())
|
||||
.betweenIfPresent(FineTuningDO::getCreateTime, reqVO.getCreateTime())
|
||||
.orderByDesc(FineTuningDO::getId));
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,29 @@
|
||||
package cn.iocoder.yudao.module.llm.dal.mysql.finetuningloss;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import cn.iocoder.yudao.module.llm.dal.dataobject.finetuningloss.FineTuningLossDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import cn.iocoder.yudao.module.llm.controller.admin.finetuningloss.vo.*;
|
||||
|
||||
/**
|
||||
* 损失记录表,用于记录每次训练的损失值 Mapper
|
||||
*
|
||||
* @author 华大大模型
|
||||
*/
|
||||
@Mapper
|
||||
public interface FineTuningLossMapper extends BaseMapperX<FineTuningLossDO> {
|
||||
|
||||
default PageResult<FineTuningLossDO> selectPage(FineTuningLossPageReqVO reqVO) {
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<FineTuningLossDO>()
|
||||
.betweenIfPresent(FineTuningLossDO::getCreateTime, reqVO.getCreateTime())
|
||||
.eqIfPresent(FineTuningLossDO::getTaskId, reqVO.getTaskId())
|
||||
.eqIfPresent(FineTuningLossDO::getEpoch, reqVO.getEpoch())
|
||||
.eqIfPresent(FineTuningLossDO::getLossValue, reqVO.getLossValue())
|
||||
.orderByDesc(FineTuningLossDO::getId));
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,32 @@
|
||||
package cn.iocoder.yudao.module.llm.dal.mysql.prompttemplates;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import cn.iocoder.yudao.module.llm.dal.dataobject.prompttemplates.PromptTemplatesDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import cn.iocoder.yudao.module.llm.controller.admin.prompttemplates.vo.*;
|
||||
|
||||
/**
|
||||
* Prompt 模板表,用于记录每个模板的信息 Mapper
|
||||
*
|
||||
* @author 华大大模型
|
||||
*/
|
||||
@Mapper
|
||||
public interface PromptTemplatesMapper extends BaseMapperX<PromptTemplatesDO> {
|
||||
|
||||
default PageResult<PromptTemplatesDO> selectPage(PromptTemplatesPageReqVO reqVO) {
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<PromptTemplatesDO>()
|
||||
.likeIfPresent(PromptTemplatesDO::getName, reqVO.getName())
|
||||
.eqIfPresent(PromptTemplatesDO::getTemplateCategory, reqVO.getTemplateCategory())
|
||||
.eqIfPresent(PromptTemplatesDO::getTemplateFramework, reqVO.getTemplateFramework())
|
||||
.eqIfPresent(PromptTemplatesDO::getTemplateText, reqVO.getTemplateText())
|
||||
.eqIfPresent(PromptTemplatesDO::getVariableIdentifier, reqVO.getVariableIdentifier())
|
||||
.eqIfPresent(PromptTemplatesDO::getTemplateType, reqVO.getTemplateType())
|
||||
.betweenIfPresent(PromptTemplatesDO::getCreateTime, reqVO.getCreateTime())
|
||||
.orderByDesc(PromptTemplatesDO::getId));
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,28 @@
|
||||
package cn.iocoder.yudao.module.llm.dal.mysql.prompttemplatesapplications;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import cn.iocoder.yudao.module.llm.dal.dataobject.prompttemplatesapplications.PromptTemplatesApplicationsDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import cn.iocoder.yudao.module.llm.controller.admin.prompttemplatesapplications.vo.*;
|
||||
|
||||
/**
|
||||
* Prompt 模板 应用关系表,记录模板和应用之间的多对多关系 Mapper
|
||||
*
|
||||
* @author 华大大模型
|
||||
*/
|
||||
@Mapper
|
||||
public interface PromptTemplatesApplicationsMapper extends BaseMapperX<PromptTemplatesApplicationsDO> {
|
||||
|
||||
default PageResult<PromptTemplatesApplicationsDO> selectPage(PromptTemplatesApplicationsPageReqVO reqVO) {
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<PromptTemplatesApplicationsDO>()
|
||||
.eqIfPresent(PromptTemplatesApplicationsDO::getPromptTemplateId, reqVO.getPromptTemplateId())
|
||||
.eqIfPresent(PromptTemplatesApplicationsDO::getApplicationId, reqVO.getApplicationId())
|
||||
.betweenIfPresent(PromptTemplatesApplicationsDO::getCreateTime, reqVO.getCreateTime())
|
||||
.orderByDesc(PromptTemplatesApplicationsDO::getId));
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,28 @@
|
||||
package cn.iocoder.yudao.module.llm.dal.mysql.prompttemplatestags;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import cn.iocoder.yudao.module.llm.dal.dataobject.prompttemplatestags.PromptTemplatesTagsDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import cn.iocoder.yudao.module.llm.controller.admin.prompttemplatestags.vo.*;
|
||||
|
||||
/**
|
||||
* Prompt 模板标签关系表,记录模板和标签之间的多对多关系 Mapper
|
||||
*
|
||||
* @author 华大大模型
|
||||
*/
|
||||
@Mapper
|
||||
public interface PromptTemplatesTagsMapper extends BaseMapperX<PromptTemplatesTagsDO> {
|
||||
|
||||
default PageResult<PromptTemplatesTagsDO> selectPage(PromptTemplatesTagsPageReqVO reqVO) {
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<PromptTemplatesTagsDO>()
|
||||
.eqIfPresent(PromptTemplatesTagsDO::getPromptTemplateId, reqVO.getPromptTemplateId())
|
||||
.eqIfPresent(PromptTemplatesTagsDO::getTagId, reqVO.getTagId())
|
||||
.betweenIfPresent(PromptTemplatesTagsDO::getCreateTime, reqVO.getCreateTime())
|
||||
.orderByDesc(PromptTemplatesTagsDO::getId));
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,55 @@
|
||||
package cn.iocoder.yudao.module.llm.service.basemodel;
|
||||
|
||||
import java.util.*;
|
||||
import javax.validation.*;
|
||||
import cn.iocoder.yudao.module.llm.controller.admin.basemodel.vo.*;
|
||||
import cn.iocoder.yudao.module.llm.dal.dataobject.basemodel.BaseModelDO;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
|
||||
/**
|
||||
* 基座模型 Service 接口
|
||||
*
|
||||
* @author 华大大模型
|
||||
*/
|
||||
public interface BaseModelService {
|
||||
|
||||
/**
|
||||
* 创建基座模型
|
||||
*
|
||||
* @param createReqVO 创建信息
|
||||
* @return 编号
|
||||
*/
|
||||
Integer createBaseModel(@Valid BaseModelSaveReqVO createReqVO);
|
||||
|
||||
/**
|
||||
* 更新基座模型
|
||||
*
|
||||
* @param updateReqVO 更新信息
|
||||
*/
|
||||
void updateBaseModel(@Valid BaseModelSaveReqVO updateReqVO);
|
||||
|
||||
/**
|
||||
* 删除基座模型
|
||||
*
|
||||
* @param id 编号
|
||||
*/
|
||||
void deleteBaseModel(Integer id);
|
||||
|
||||
/**
|
||||
* 获得基座模型
|
||||
*
|
||||
* @param id 编号
|
||||
* @return 基座模型
|
||||
*/
|
||||
BaseModelDO getBaseModel(Integer id);
|
||||
|
||||
/**
|
||||
* 获得基座模型分页
|
||||
*
|
||||
* @param pageReqVO 分页查询
|
||||
* @return 基座模型分页
|
||||
*/
|
||||
PageResult<BaseModelDO> getBaseModelPage(BaseModelPageReqVO pageReqVO);
|
||||
|
||||
}
|
@ -0,0 +1,74 @@
|
||||
package cn.iocoder.yudao.module.llm.service.basemodel;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
import javax.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.*;
|
||||
import cn.iocoder.yudao.module.llm.controller.admin.basemodel.vo.*;
|
||||
import cn.iocoder.yudao.module.llm.dal.dataobject.basemodel.BaseModelDO;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
|
||||
import cn.iocoder.yudao.module.llm.dal.mysql.basemodel.BaseModelMapper;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
import static cn.iocoder.yudao.module.llm.enums.ErrorCodeConstants.*;
|
||||
|
||||
/**
|
||||
* 基座模型 Service 实现类
|
||||
*
|
||||
* @author 华大大模型
|
||||
*/
|
||||
@Service
|
||||
@Validated
|
||||
public class BaseModelServiceImpl implements BaseModelService {
|
||||
|
||||
@Resource
|
||||
private BaseModelMapper baseModelMapper;
|
||||
|
||||
@Override
|
||||
public Integer createBaseModel(BaseModelSaveReqVO createReqVO) {
|
||||
// 插入
|
||||
BaseModelDO baseModel = BeanUtils.toBean(createReqVO, BaseModelDO.class);
|
||||
baseModelMapper.insert(baseModel);
|
||||
// 返回
|
||||
return baseModel.getId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateBaseModel(BaseModelSaveReqVO updateReqVO) {
|
||||
// 校验存在
|
||||
validateBaseModelExists(updateReqVO.getId());
|
||||
// 更新
|
||||
BaseModelDO updateObj = BeanUtils.toBean(updateReqVO, BaseModelDO.class);
|
||||
baseModelMapper.updateById(updateObj);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteBaseModel(Integer id) {
|
||||
// 校验存在
|
||||
validateBaseModelExists(id);
|
||||
// 删除
|
||||
baseModelMapper.deleteById(id);
|
||||
}
|
||||
|
||||
private void validateBaseModelExists(Integer id) {
|
||||
if (baseModelMapper.selectById(id) == null) {
|
||||
throw exception(BASE_MODEL_NOT_EXISTS);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public BaseModelDO getBaseModel(Integer id) {
|
||||
return baseModelMapper.selectById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<BaseModelDO> getBaseModelPage(BaseModelPageReqVO pageReqVO) {
|
||||
return baseModelMapper.selectPage(pageReqVO);
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,55 @@
|
||||
package cn.iocoder.yudao.module.llm.service.conversation;
|
||||
|
||||
import java.util.*;
|
||||
import javax.validation.*;
|
||||
import cn.iocoder.yudao.module.llm.controller.admin.conversation.vo.*;
|
||||
import cn.iocoder.yudao.module.llm.dal.dataobject.conversation.ConversationDO;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
|
||||
/**
|
||||
* 大模型对话记录 Service 接口
|
||||
*
|
||||
* @author 华大大模型
|
||||
*/
|
||||
public interface ConversationService {
|
||||
|
||||
/**
|
||||
* 创建大模型对话记录
|
||||
*
|
||||
* @param createReqVO 创建信息
|
||||
* @return 编号
|
||||
*/
|
||||
Integer createConversation(@Valid ConversationSaveReqVO createReqVO);
|
||||
|
||||
/**
|
||||
* 更新大模型对话记录
|
||||
*
|
||||
* @param updateReqVO 更新信息
|
||||
*/
|
||||
void updateConversation(@Valid ConversationSaveReqVO updateReqVO);
|
||||
|
||||
/**
|
||||
* 删除大模型对话记录
|
||||
*
|
||||
* @param id 编号
|
||||
*/
|
||||
void deleteConversation(Integer id);
|
||||
|
||||
/**
|
||||
* 获得大模型对话记录
|
||||
*
|
||||
* @param id 编号
|
||||
* @return 大模型对话记录
|
||||
*/
|
||||
ConversationDO getConversation(Integer id);
|
||||
|
||||
/**
|
||||
* 获得大模型对话记录分页
|
||||
*
|
||||
* @param pageReqVO 分页查询
|
||||
* @return 大模型对话记录分页
|
||||
*/
|
||||
PageResult<ConversationDO> getConversationPage(ConversationPageReqVO pageReqVO);
|
||||
|
||||
}
|
@ -0,0 +1,74 @@
|
||||
package cn.iocoder.yudao.module.llm.service.conversation;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
import javax.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.*;
|
||||
import cn.iocoder.yudao.module.llm.controller.admin.conversation.vo.*;
|
||||
import cn.iocoder.yudao.module.llm.dal.dataobject.conversation.ConversationDO;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
|
||||
import cn.iocoder.yudao.module.llm.dal.mysql.conversation.ConversationMapper;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
import static cn.iocoder.yudao.module.llm.enums.ErrorCodeConstants.*;
|
||||
|
||||
/**
|
||||
* 大模型对话记录 Service 实现类
|
||||
*
|
||||
* @author 华大大模型
|
||||
*/
|
||||
@Service
|
||||
@Validated
|
||||
public class ConversationServiceImpl implements ConversationService {
|
||||
|
||||
@Resource
|
||||
private ConversationMapper conversationMapper;
|
||||
|
||||
@Override
|
||||
public Integer createConversation(ConversationSaveReqVO createReqVO) {
|
||||
// 插入
|
||||
ConversationDO conversation = BeanUtils.toBean(createReqVO, ConversationDO.class);
|
||||
conversationMapper.insert(conversation);
|
||||
// 返回
|
||||
return conversation.getId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateConversation(ConversationSaveReqVO updateReqVO) {
|
||||
// 校验存在
|
||||
validateConversationExists(updateReqVO.getId());
|
||||
// 更新
|
||||
ConversationDO updateObj = BeanUtils.toBean(updateReqVO, ConversationDO.class);
|
||||
conversationMapper.updateById(updateObj);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteConversation(Integer id) {
|
||||
// 校验存在
|
||||
validateConversationExists(id);
|
||||
// 删除
|
||||
conversationMapper.deleteById(id);
|
||||
}
|
||||
|
||||
private void validateConversationExists(Integer id) {
|
||||
if (conversationMapper.selectById(id) == null) {
|
||||
throw exception(CONVERSATION_NOT_EXISTS);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ConversationDO getConversation(Integer id) {
|
||||
return conversationMapper.selectById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<ConversationDO> getConversationPage(ConversationPageReqVO pageReqVO) {
|
||||
return conversationMapper.selectPage(pageReqVO);
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,55 @@
|
||||
package cn.iocoder.yudao.module.llm.service.dataprocesstask;
|
||||
|
||||
import java.util.*;
|
||||
import javax.validation.*;
|
||||
import cn.iocoder.yudao.module.llm.controller.admin.dataprocesstask.vo.*;
|
||||
import cn.iocoder.yudao.module.llm.dal.dataobject.dataprocesstask.DataProcessTaskDO;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
|
||||
/**
|
||||
* 数据处理任务 Service 接口
|
||||
*
|
||||
* @author 华大大模型
|
||||
*/
|
||||
public interface DataProcessTaskService {
|
||||
|
||||
/**
|
||||
* 创建数据处理任务
|
||||
*
|
||||
* @param createReqVO 创建信息
|
||||
* @return 编号
|
||||
*/
|
||||
Long createDataProcessTask(@Valid DataProcessTaskSaveReqVO createReqVO);
|
||||
|
||||
/**
|
||||
* 更新数据处理任务
|
||||
*
|
||||
* @param updateReqVO 更新信息
|
||||
*/
|
||||
void updateDataProcessTask(@Valid DataProcessTaskSaveReqVO updateReqVO);
|
||||
|
||||
/**
|
||||
* 删除数据处理任务
|
||||
*
|
||||
* @param id 编号
|
||||
*/
|
||||
void deleteDataProcessTask(Long id);
|
||||
|
||||
/**
|
||||
* 获得数据处理任务
|
||||
*
|
||||
* @param id 编号
|
||||
* @return 数据处理任务
|
||||
*/
|
||||
DataProcessTaskDO getDataProcessTask(Long id);
|
||||
|
||||
/**
|
||||
* 获得数据处理任务分页
|
||||
*
|
||||
* @param pageReqVO 分页查询
|
||||
* @return 数据处理任务分页
|
||||
*/
|
||||
PageResult<DataProcessTaskDO> getDataProcessTaskPage(DataProcessTaskPageReqVO pageReqVO);
|
||||
|
||||
}
|
@ -0,0 +1,74 @@
|
||||
package cn.iocoder.yudao.module.llm.service.dataprocesstask;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
import javax.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.*;
|
||||
import cn.iocoder.yudao.module.llm.controller.admin.dataprocesstask.vo.*;
|
||||
import cn.iocoder.yudao.module.llm.dal.dataobject.dataprocesstask.DataProcessTaskDO;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
|
||||
import cn.iocoder.yudao.module.llm.dal.mysql.dataprocesstask.DataProcessTaskMapper;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
import static cn.iocoder.yudao.module.llm.enums.ErrorCodeConstants.*;
|
||||
|
||||
/**
|
||||
* 数据处理任务 Service 实现类
|
||||
*
|
||||
* @author 华大大模型
|
||||
*/
|
||||
@Service
|
||||
@Validated
|
||||
public class DataProcessTaskServiceImpl implements DataProcessTaskService {
|
||||
|
||||
@Resource
|
||||
private DataProcessTaskMapper dataProcessTaskMapper;
|
||||
|
||||
@Override
|
||||
public Long createDataProcessTask(DataProcessTaskSaveReqVO createReqVO) {
|
||||
// 插入
|
||||
DataProcessTaskDO dataProcessTask = BeanUtils.toBean(createReqVO, DataProcessTaskDO.class);
|
||||
dataProcessTaskMapper.insert(dataProcessTask);
|
||||
// 返回
|
||||
return dataProcessTask.getId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateDataProcessTask(DataProcessTaskSaveReqVO updateReqVO) {
|
||||
// 校验存在
|
||||
validateDataProcessTaskExists(updateReqVO.getId());
|
||||
// 更新
|
||||
DataProcessTaskDO updateObj = BeanUtils.toBean(updateReqVO, DataProcessTaskDO.class);
|
||||
dataProcessTaskMapper.updateById(updateObj);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteDataProcessTask(Long id) {
|
||||
// 校验存在
|
||||
validateDataProcessTaskExists(id);
|
||||
// 删除
|
||||
dataProcessTaskMapper.deleteById(id);
|
||||
}
|
||||
|
||||
private void validateDataProcessTaskExists(Long id) {
|
||||
if (dataProcessTaskMapper.selectById(id) == null) {
|
||||
throw exception(DATA_PROCESS_TASK_NOT_EXISTS);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public DataProcessTaskDO getDataProcessTask(Long id) {
|
||||
return dataProcessTaskMapper.selectById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<DataProcessTaskDO> getDataProcessTaskPage(DataProcessTaskPageReqVO pageReqVO) {
|
||||
return dataProcessTaskMapper.selectPage(pageReqVO);
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,55 @@
|
||||
package cn.iocoder.yudao.module.llm.service.datasetanswer;
|
||||
|
||||
import java.util.*;
|
||||
import javax.validation.*;
|
||||
import cn.iocoder.yudao.module.llm.controller.admin.datasetanswer.vo.*;
|
||||
import cn.iocoder.yudao.module.llm.dal.dataobject.datasetanswer.DatasetAnswerDO;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
|
||||
/**
|
||||
* 数据集数据问题标注内容 Service 接口
|
||||
*
|
||||
* @author 华大大模型
|
||||
*/
|
||||
public interface DatasetAnswerService {
|
||||
|
||||
/**
|
||||
* 创建数据集数据问题标注内容
|
||||
*
|
||||
* @param createReqVO 创建信息
|
||||
* @return 编号
|
||||
*/
|
||||
Long createDatasetAnswer(@Valid DatasetAnswerSaveReqVO createReqVO);
|
||||
|
||||
/**
|
||||
* 更新数据集数据问题标注内容
|
||||
*
|
||||
* @param updateReqVO 更新信息
|
||||
*/
|
||||
void updateDatasetAnswer(@Valid DatasetAnswerSaveReqVO updateReqVO);
|
||||
|
||||
/**
|
||||
* 删除数据集数据问题标注内容
|
||||
*
|
||||
* @param id 编号
|
||||
*/
|
||||
void deleteDatasetAnswer(Long id);
|
||||
|
||||
/**
|
||||
* 获得数据集数据问题标注内容
|
||||
*
|
||||
* @param id 编号
|
||||
* @return 数据集数据问题标注内容
|
||||
*/
|
||||
DatasetAnswerDO getDatasetAnswer(Long id);
|
||||
|
||||
/**
|
||||
* 获得数据集数据问题标注内容分页
|
||||
*
|
||||
* @param pageReqVO 分页查询
|
||||
* @return 数据集数据问题标注内容分页
|
||||
*/
|
||||
PageResult<DatasetAnswerDO> getDatasetAnswerPage(DatasetAnswerPageReqVO pageReqVO);
|
||||
|
||||
}
|
@ -0,0 +1,74 @@
|
||||
package cn.iocoder.yudao.module.llm.service.datasetanswer;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
import javax.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.*;
|
||||
import cn.iocoder.yudao.module.llm.controller.admin.datasetanswer.vo.*;
|
||||
import cn.iocoder.yudao.module.llm.dal.dataobject.datasetanswer.DatasetAnswerDO;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
|
||||
import cn.iocoder.yudao.module.llm.dal.mysql.datasetanswer.DatasetAnswerMapper;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
import static cn.iocoder.yudao.module.llm.enums.ErrorCodeConstants.*;
|
||||
|
||||
/**
|
||||
* 数据集数据问题标注内容 Service 实现类
|
||||
*
|
||||
* @author 华大大模型
|
||||
*/
|
||||
@Service
|
||||
@Validated
|
||||
public class DatasetAnswerServiceImpl implements DatasetAnswerService {
|
||||
|
||||
@Resource
|
||||
private DatasetAnswerMapper datasetAnswerMapper;
|
||||
|
||||
@Override
|
||||
public Long createDatasetAnswer(DatasetAnswerSaveReqVO createReqVO) {
|
||||
// 插入
|
||||
DatasetAnswerDO datasetAnswer = BeanUtils.toBean(createReqVO, DatasetAnswerDO.class);
|
||||
datasetAnswerMapper.insert(datasetAnswer);
|
||||
// 返回
|
||||
return datasetAnswer.getId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateDatasetAnswer(DatasetAnswerSaveReqVO updateReqVO) {
|
||||
// 校验存在
|
||||
validateDatasetAnswerExists(updateReqVO.getId());
|
||||
// 更新
|
||||
DatasetAnswerDO updateObj = BeanUtils.toBean(updateReqVO, DatasetAnswerDO.class);
|
||||
datasetAnswerMapper.updateById(updateObj);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteDatasetAnswer(Long id) {
|
||||
// 校验存在
|
||||
validateDatasetAnswerExists(id);
|
||||
// 删除
|
||||
datasetAnswerMapper.deleteById(id);
|
||||
}
|
||||
|
||||
private void validateDatasetAnswerExists(Long id) {
|
||||
if (datasetAnswerMapper.selectById(id) == null) {
|
||||
throw exception(DATASET_ANSWER_NOT_EXISTS);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public DatasetAnswerDO getDatasetAnswer(Long id) {
|
||||
return datasetAnswerMapper.selectById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<DatasetAnswerDO> getDatasetAnswerPage(DatasetAnswerPageReqVO pageReqVO) {
|
||||
return datasetAnswerMapper.selectPage(pageReqVO);
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,55 @@
|
||||
package cn.iocoder.yudao.module.llm.service.datasetfiles;
|
||||
|
||||
import java.util.*;
|
||||
import javax.validation.*;
|
||||
import cn.iocoder.yudao.module.llm.controller.admin.datasetfiles.vo.*;
|
||||
import cn.iocoder.yudao.module.llm.dal.dataobject.datasetfiles.DatasetFilesDO;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
|
||||
/**
|
||||
* 数据集数据文件 Service 接口
|
||||
*
|
||||
* @author 华大大模型
|
||||
*/
|
||||
public interface DatasetFilesService {
|
||||
|
||||
/**
|
||||
* 创建数据集数据文件
|
||||
*
|
||||
* @param createReqVO 创建信息
|
||||
* @return 编号
|
||||
*/
|
||||
Long createDatasetFiles(@Valid DatasetFilesSaveReqVO createReqVO);
|
||||
|
||||
/**
|
||||
* 更新数据集数据文件
|
||||
*
|
||||
* @param updateReqVO 更新信息
|
||||
*/
|
||||
void updateDatasetFiles(@Valid DatasetFilesSaveReqVO updateReqVO);
|
||||
|
||||
/**
|
||||
* 删除数据集数据文件
|
||||
*
|
||||
* @param id 编号
|
||||
*/
|
||||
void deleteDatasetFiles(Long id);
|
||||
|
||||
/**
|
||||
* 获得数据集数据文件
|
||||
*
|
||||
* @param id 编号
|
||||
* @return 数据集数据文件
|
||||
*/
|
||||
DatasetFilesDO getDatasetFiles(Long id);
|
||||
|
||||
/**
|
||||
* 获得数据集数据文件分页
|
||||
*
|
||||
* @param pageReqVO 分页查询
|
||||
* @return 数据集数据文件分页
|
||||
*/
|
||||
PageResult<DatasetFilesDO> getDatasetFilesPage(DatasetFilesPageReqVO pageReqVO);
|
||||
|
||||
}
|
@ -0,0 +1,74 @@
|
||||
package cn.iocoder.yudao.module.llm.service.datasetfiles;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
import javax.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.*;
|
||||
import cn.iocoder.yudao.module.llm.controller.admin.datasetfiles.vo.*;
|
||||
import cn.iocoder.yudao.module.llm.dal.dataobject.datasetfiles.DatasetFilesDO;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
|
||||
import cn.iocoder.yudao.module.llm.dal.mysql.datasetfiles.DatasetFilesMapper;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
import static cn.iocoder.yudao.module.llm.enums.ErrorCodeConstants.*;
|
||||
|
||||
/**
|
||||
* 数据集数据文件 Service 实现类
|
||||
*
|
||||
* @author 华大大模型
|
||||
*/
|
||||
@Service
|
||||
@Validated
|
||||
public class DatasetFilesServiceImpl implements DatasetFilesService {
|
||||
|
||||
@Resource
|
||||
private DatasetFilesMapper datasetFilesMapper;
|
||||
|
||||
@Override
|
||||
public Long createDatasetFiles(DatasetFilesSaveReqVO createReqVO) {
|
||||
// 插入
|
||||
DatasetFilesDO datasetFiles = BeanUtils.toBean(createReqVO, DatasetFilesDO.class);
|
||||
datasetFilesMapper.insert(datasetFiles);
|
||||
// 返回
|
||||
return datasetFiles.getId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateDatasetFiles(DatasetFilesSaveReqVO updateReqVO) {
|
||||
// 校验存在
|
||||
validateDatasetFilesExists(updateReqVO.getId());
|
||||
// 更新
|
||||
DatasetFilesDO updateObj = BeanUtils.toBean(updateReqVO, DatasetFilesDO.class);
|
||||
datasetFilesMapper.updateById(updateObj);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteDatasetFiles(Long id) {
|
||||
// 校验存在
|
||||
validateDatasetFilesExists(id);
|
||||
// 删除
|
||||
datasetFilesMapper.deleteById(id);
|
||||
}
|
||||
|
||||
private void validateDatasetFilesExists(Long id) {
|
||||
if (datasetFilesMapper.selectById(id) == null) {
|
||||
throw exception(DATASET_FILES_NOT_EXISTS);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public DatasetFilesDO getDatasetFiles(Long id) {
|
||||
return datasetFilesMapper.selectById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<DatasetFilesDO> getDatasetFilesPage(DatasetFilesPageReqVO pageReqVO) {
|
||||
return datasetFilesMapper.selectPage(pageReqVO);
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,55 @@
|
||||
package cn.iocoder.yudao.module.llm.service.datasetquestion;
|
||||
|
||||
import java.util.*;
|
||||
import javax.validation.*;
|
||||
import cn.iocoder.yudao.module.llm.controller.admin.datasetquestion.vo.*;
|
||||
import cn.iocoder.yudao.module.llm.dal.dataobject.datasetquestion.DatasetQuestionDO;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
|
||||
/**
|
||||
* 数据集数据问题 Service 接口
|
||||
*
|
||||
* @author 华大大模型
|
||||
*/
|
||||
public interface DatasetQuestionService {
|
||||
|
||||
/**
|
||||
* 创建数据集数据问题
|
||||
*
|
||||
* @param createReqVO 创建信息
|
||||
* @return 编号
|
||||
*/
|
||||
Long createDatasetQuestion(@Valid DatasetQuestionSaveReqVO createReqVO);
|
||||
|
||||
/**
|
||||
* 更新数据集数据问题
|
||||
*
|
||||
* @param updateReqVO 更新信息
|
||||
*/
|
||||
void updateDatasetQuestion(@Valid DatasetQuestionSaveReqVO updateReqVO);
|
||||
|
||||
/**
|
||||
* 删除数据集数据问题
|
||||
*
|
||||
* @param id 编号
|
||||
*/
|
||||
void deleteDatasetQuestion(Long id);
|
||||
|
||||
/**
|
||||
* 获得数据集数据问题
|
||||
*
|
||||
* @param id 编号
|
||||
* @return 数据集数据问题
|
||||
*/
|
||||
DatasetQuestionDO getDatasetQuestion(Long id);
|
||||
|
||||
/**
|
||||
* 获得数据集数据问题分页
|
||||
*
|
||||
* @param pageReqVO 分页查询
|
||||
* @return 数据集数据问题分页
|
||||
*/
|
||||
PageResult<DatasetQuestionDO> getDatasetQuestionPage(DatasetQuestionPageReqVO pageReqVO);
|
||||
|
||||
}
|
@ -0,0 +1,74 @@
|
||||
package cn.iocoder.yudao.module.llm.service.datasetquestion;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
import javax.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.*;
|
||||
import cn.iocoder.yudao.module.llm.controller.admin.datasetquestion.vo.*;
|
||||
import cn.iocoder.yudao.module.llm.dal.dataobject.datasetquestion.DatasetQuestionDO;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
|
||||
import cn.iocoder.yudao.module.llm.dal.mysql.datasetquestion.DatasetQuestionMapper;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
import static cn.iocoder.yudao.module.llm.enums.ErrorCodeConstants.*;
|
||||
|
||||
/**
|
||||
* 数据集数据问题 Service 实现类
|
||||
*
|
||||
* @author 华大大模型
|
||||
*/
|
||||
@Service
|
||||
@Validated
|
||||
public class DatasetQuestionServiceImpl implements DatasetQuestionService {
|
||||
|
||||
@Resource
|
||||
private DatasetQuestionMapper datasetQuestionMapper;
|
||||
|
||||
@Override
|
||||
public Long createDatasetQuestion(DatasetQuestionSaveReqVO createReqVO) {
|
||||
// 插入
|
||||
DatasetQuestionDO datasetQuestion = BeanUtils.toBean(createReqVO, DatasetQuestionDO.class);
|
||||
datasetQuestionMapper.insert(datasetQuestion);
|
||||
// 返回
|
||||
return datasetQuestion.getId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateDatasetQuestion(DatasetQuestionSaveReqVO updateReqVO) {
|
||||
// 校验存在
|
||||
validateDatasetQuestionExists(updateReqVO.getId());
|
||||
// 更新
|
||||
DatasetQuestionDO updateObj = BeanUtils.toBean(updateReqVO, DatasetQuestionDO.class);
|
||||
datasetQuestionMapper.updateById(updateObj);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteDatasetQuestion(Long id) {
|
||||
// 校验存在
|
||||
validateDatasetQuestionExists(id);
|
||||
// 删除
|
||||
datasetQuestionMapper.deleteById(id);
|
||||
}
|
||||
|
||||
private void validateDatasetQuestionExists(Long id) {
|
||||
if (datasetQuestionMapper.selectById(id) == null) {
|
||||
throw exception(DATASET_QUESTION_NOT_EXISTS);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public DatasetQuestionDO getDatasetQuestion(Long id) {
|
||||
return datasetQuestionMapper.selectById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<DatasetQuestionDO> getDatasetQuestionPage(DatasetQuestionPageReqVO pageReqVO) {
|
||||
return datasetQuestionMapper.selectPage(pageReqVO);
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,55 @@
|
||||
package cn.iocoder.yudao.module.llm.service.finetuning;
|
||||
|
||||
import java.util.*;
|
||||
import javax.validation.*;
|
||||
import cn.iocoder.yudao.module.llm.controller.admin.finetuning.vo.*;
|
||||
import cn.iocoder.yudao.module.llm.dal.dataobject.finetuning.FineTuningDO;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
|
||||
/**
|
||||
* 模型微调 Service 接口
|
||||
*
|
||||
* @author 华大大模型
|
||||
*/
|
||||
public interface FineTuningService {
|
||||
|
||||
/**
|
||||
* 创建模型微调
|
||||
*
|
||||
* @param createReqVO 创建信息
|
||||
* @return 编号
|
||||
*/
|
||||
Integer createFineTuning(@Valid FineTuningSaveReqVO createReqVO);
|
||||
|
||||
/**
|
||||
* 更新模型微调
|
||||
*
|
||||
* @param updateReqVO 更新信息
|
||||
*/
|
||||
void updateFineTuning(@Valid FineTuningSaveReqVO updateReqVO);
|
||||
|
||||
/**
|
||||
* 删除模型微调
|
||||
*
|
||||
* @param id 编号
|
||||
*/
|
||||
void deleteFineTuning(Integer id);
|
||||
|
||||
/**
|
||||
* 获得模型微调
|
||||
*
|
||||
* @param id 编号
|
||||
* @return 模型微调
|
||||
*/
|
||||
FineTuningDO getFineTuning(Integer id);
|
||||
|
||||
/**
|
||||
* 获得模型微调分页
|
||||
*
|
||||
* @param pageReqVO 分页查询
|
||||
* @return 模型微调分页
|
||||
*/
|
||||
PageResult<FineTuningDO> getFineTuningPage(FineTuningPageReqVO pageReqVO);
|
||||
|
||||
}
|
@ -0,0 +1,74 @@
|
||||
package cn.iocoder.yudao.module.llm.service.finetuning;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
import javax.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.*;
|
||||
import cn.iocoder.yudao.module.llm.controller.admin.finetuning.vo.*;
|
||||
import cn.iocoder.yudao.module.llm.dal.dataobject.finetuning.FineTuningDO;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
|
||||
import cn.iocoder.yudao.module.llm.dal.mysql.finetuning.FineTuningMapper;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
import static cn.iocoder.yudao.module.llm.enums.ErrorCodeConstants.*;
|
||||
|
||||
/**
|
||||
* 模型微调 Service 实现类
|
||||
*
|
||||
* @author 华大大模型
|
||||
*/
|
||||
@Service
|
||||
@Validated
|
||||
public class FineTuningServiceImpl implements FineTuningService {
|
||||
|
||||
@Resource
|
||||
private FineTuningMapper fineTuningMapper;
|
||||
|
||||
@Override
|
||||
public Integer createFineTuning(FineTuningSaveReqVO createReqVO) {
|
||||
// 插入
|
||||
FineTuningDO fineTuning = BeanUtils.toBean(createReqVO, FineTuningDO.class);
|
||||
fineTuningMapper.insert(fineTuning);
|
||||
// 返回
|
||||
return fineTuning.getId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateFineTuning(FineTuningSaveReqVO updateReqVO) {
|
||||
// 校验存在
|
||||
validateFineTuningExists(updateReqVO.getId());
|
||||
// 更新
|
||||
FineTuningDO updateObj = BeanUtils.toBean(updateReqVO, FineTuningDO.class);
|
||||
fineTuningMapper.updateById(updateObj);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteFineTuning(Integer id) {
|
||||
// 校验存在
|
||||
validateFineTuningExists(id);
|
||||
// 删除
|
||||
fineTuningMapper.deleteById(id);
|
||||
}
|
||||
|
||||
private void validateFineTuningExists(Integer id) {
|
||||
if (fineTuningMapper.selectById(id) == null) {
|
||||
throw exception(FINE_TUNING_NOT_EXISTS);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public FineTuningDO getFineTuning(Integer id) {
|
||||
return fineTuningMapper.selectById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<FineTuningDO> getFineTuningPage(FineTuningPageReqVO pageReqVO) {
|
||||
return fineTuningMapper.selectPage(pageReqVO);
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,55 @@
|
||||
package cn.iocoder.yudao.module.llm.service.finetuningloss;
|
||||
|
||||
import java.util.*;
|
||||
import javax.validation.*;
|
||||
import cn.iocoder.yudao.module.llm.controller.admin.finetuningloss.vo.*;
|
||||
import cn.iocoder.yudao.module.llm.dal.dataobject.finetuningloss.FineTuningLossDO;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
|
||||
/**
|
||||
* 损失记录表,用于记录每次训练的损失值 Service 接口
|
||||
*
|
||||
* @author 华大大模型
|
||||
*/
|
||||
public interface FineTuningLossService {
|
||||
|
||||
/**
|
||||
* 创建损失记录表,用于记录每次训练的损失值
|
||||
*
|
||||
* @param createReqVO 创建信息
|
||||
* @return 编号
|
||||
*/
|
||||
Long createFineTuningLoss(@Valid FineTuningLossSaveReqVO createReqVO);
|
||||
|
||||
/**
|
||||
* 更新损失记录表,用于记录每次训练的损失值
|
||||
*
|
||||
* @param updateReqVO 更新信息
|
||||
*/
|
||||
void updateFineTuningLoss(@Valid FineTuningLossSaveReqVO updateReqVO);
|
||||
|
||||
/**
|
||||
* 删除损失记录表,用于记录每次训练的损失值
|
||||
*
|
||||
* @param id 编号
|
||||
*/
|
||||
void deleteFineTuningLoss(Long id);
|
||||
|
||||
/**
|
||||
* 获得损失记录表,用于记录每次训练的损失值
|
||||
*
|
||||
* @param id 编号
|
||||
* @return 损失记录表,用于记录每次训练的损失值
|
||||
*/
|
||||
FineTuningLossDO getFineTuningLoss(Long id);
|
||||
|
||||
/**
|
||||
* 获得损失记录表,用于记录每次训练的损失值分页
|
||||
*
|
||||
* @param pageReqVO 分页查询
|
||||
* @return 损失记录表,用于记录每次训练的损失值分页
|
||||
*/
|
||||
PageResult<FineTuningLossDO> getFineTuningLossPage(FineTuningLossPageReqVO pageReqVO);
|
||||
|
||||
}
|
@ -0,0 +1,74 @@
|
||||
package cn.iocoder.yudao.module.llm.service.finetuningloss;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
import javax.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.*;
|
||||
import cn.iocoder.yudao.module.llm.controller.admin.finetuningloss.vo.*;
|
||||
import cn.iocoder.yudao.module.llm.dal.dataobject.finetuningloss.FineTuningLossDO;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
|
||||
import cn.iocoder.yudao.module.llm.dal.mysql.finetuningloss.FineTuningLossMapper;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
import static cn.iocoder.yudao.module.llm.enums.ErrorCodeConstants.*;
|
||||
|
||||
/**
|
||||
* 损失记录表,用于记录每次训练的损失值 Service 实现类
|
||||
*
|
||||
* @author 华大大模型
|
||||
*/
|
||||
@Service
|
||||
@Validated
|
||||
public class FineTuningLossServiceImpl implements FineTuningLossService {
|
||||
|
||||
@Resource
|
||||
private FineTuningLossMapper fineTuningLossMapper;
|
||||
|
||||
@Override
|
||||
public Long createFineTuningLoss(FineTuningLossSaveReqVO createReqVO) {
|
||||
// 插入
|
||||
FineTuningLossDO fineTuningLoss = BeanUtils.toBean(createReqVO, FineTuningLossDO.class);
|
||||
fineTuningLossMapper.insert(fineTuningLoss);
|
||||
// 返回
|
||||
return fineTuningLoss.getId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateFineTuningLoss(FineTuningLossSaveReqVO updateReqVO) {
|
||||
// 校验存在
|
||||
validateFineTuningLossExists(updateReqVO.getId());
|
||||
// 更新
|
||||
FineTuningLossDO updateObj = BeanUtils.toBean(updateReqVO, FineTuningLossDO.class);
|
||||
fineTuningLossMapper.updateById(updateObj);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteFineTuningLoss(Long id) {
|
||||
// 校验存在
|
||||
validateFineTuningLossExists(id);
|
||||
// 删除
|
||||
fineTuningLossMapper.deleteById(id);
|
||||
}
|
||||
|
||||
private void validateFineTuningLossExists(Long id) {
|
||||
if (fineTuningLossMapper.selectById(id) == null) {
|
||||
throw exception(FINE_TUNING_LOSS_NOT_EXISTS);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public FineTuningLossDO getFineTuningLoss(Long id) {
|
||||
return fineTuningLossMapper.selectById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<FineTuningLossDO> getFineTuningLossPage(FineTuningLossPageReqVO pageReqVO) {
|
||||
return fineTuningLossMapper.selectPage(pageReqVO);
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,55 @@
|
||||
package cn.iocoder.yudao.module.llm.service.prompttemplates;
|
||||
|
||||
import java.util.*;
|
||||
import javax.validation.*;
|
||||
import cn.iocoder.yudao.module.llm.controller.admin.prompttemplates.vo.*;
|
||||
import cn.iocoder.yudao.module.llm.dal.dataobject.prompttemplates.PromptTemplatesDO;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
|
||||
/**
|
||||
* Prompt 模板表,用于记录每个模板的信息 Service 接口
|
||||
*
|
||||
* @author 华大大模型
|
||||
*/
|
||||
public interface PromptTemplatesService {
|
||||
|
||||
/**
|
||||
* 创建Prompt 模板表,用于记录每个模板的信息
|
||||
*
|
||||
* @param createReqVO 创建信息
|
||||
* @return 编号
|
||||
*/
|
||||
Long createPromptTemplates(@Valid PromptTemplatesSaveReqVO createReqVO);
|
||||
|
||||
/**
|
||||
* 更新Prompt 模板表,用于记录每个模板的信息
|
||||
*
|
||||
* @param updateReqVO 更新信息
|
||||
*/
|
||||
void updatePromptTemplates(@Valid PromptTemplatesSaveReqVO updateReqVO);
|
||||
|
||||
/**
|
||||
* 删除Prompt 模板表,用于记录每个模板的信息
|
||||
*
|
||||
* @param id 编号
|
||||
*/
|
||||
void deletePromptTemplates(Long id);
|
||||
|
||||
/**
|
||||
* 获得Prompt 模板表,用于记录每个模板的信息
|
||||
*
|
||||
* @param id 编号
|
||||
* @return Prompt 模板表,用于记录每个模板的信息
|
||||
*/
|
||||
PromptTemplatesDO getPromptTemplates(Long id);
|
||||
|
||||
/**
|
||||
* 获得Prompt 模板表,用于记录每个模板的信息分页
|
||||
*
|
||||
* @param pageReqVO 分页查询
|
||||
* @return Prompt 模板表,用于记录每个模板的信息分页
|
||||
*/
|
||||
PageResult<PromptTemplatesDO> getPromptTemplatesPage(PromptTemplatesPageReqVO pageReqVO);
|
||||
|
||||
}
|
@ -0,0 +1,74 @@
|
||||
package cn.iocoder.yudao.module.llm.service.prompttemplates;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
import javax.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.*;
|
||||
import cn.iocoder.yudao.module.llm.controller.admin.prompttemplates.vo.*;
|
||||
import cn.iocoder.yudao.module.llm.dal.dataobject.prompttemplates.PromptTemplatesDO;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
|
||||
import cn.iocoder.yudao.module.llm.dal.mysql.prompttemplates.PromptTemplatesMapper;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
import static cn.iocoder.yudao.module.llm.enums.ErrorCodeConstants.*;
|
||||
|
||||
/**
|
||||
* Prompt 模板表,用于记录每个模板的信息 Service 实现类
|
||||
*
|
||||
* @author 华大大模型
|
||||
*/
|
||||
@Service
|
||||
@Validated
|
||||
public class PromptTemplatesServiceImpl implements PromptTemplatesService {
|
||||
|
||||
@Resource
|
||||
private PromptTemplatesMapper promptTemplatesMapper;
|
||||
|
||||
@Override
|
||||
public Long createPromptTemplates(PromptTemplatesSaveReqVO createReqVO) {
|
||||
// 插入
|
||||
PromptTemplatesDO promptTemplates = BeanUtils.toBean(createReqVO, PromptTemplatesDO.class);
|
||||
promptTemplatesMapper.insert(promptTemplates);
|
||||
// 返回
|
||||
return promptTemplates.getId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updatePromptTemplates(PromptTemplatesSaveReqVO updateReqVO) {
|
||||
// 校验存在
|
||||
validatePromptTemplatesExists(updateReqVO.getId());
|
||||
// 更新
|
||||
PromptTemplatesDO updateObj = BeanUtils.toBean(updateReqVO, PromptTemplatesDO.class);
|
||||
promptTemplatesMapper.updateById(updateObj);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deletePromptTemplates(Long id) {
|
||||
// 校验存在
|
||||
validatePromptTemplatesExists(id);
|
||||
// 删除
|
||||
promptTemplatesMapper.deleteById(id);
|
||||
}
|
||||
|
||||
private void validatePromptTemplatesExists(Long id) {
|
||||
if (promptTemplatesMapper.selectById(id) == null) {
|
||||
throw exception(PROMPT_TEMPLATES_NOT_EXISTS);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public PromptTemplatesDO getPromptTemplates(Long id) {
|
||||
return promptTemplatesMapper.selectById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<PromptTemplatesDO> getPromptTemplatesPage(PromptTemplatesPageReqVO pageReqVO) {
|
||||
return promptTemplatesMapper.selectPage(pageReqVO);
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,55 @@
|
||||
package cn.iocoder.yudao.module.llm.service.prompttemplatesapplications;
|
||||
|
||||
import java.util.*;
|
||||
import javax.validation.*;
|
||||
import cn.iocoder.yudao.module.llm.controller.admin.prompttemplatesapplications.vo.*;
|
||||
import cn.iocoder.yudao.module.llm.dal.dataobject.prompttemplatesapplications.PromptTemplatesApplicationsDO;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
|
||||
/**
|
||||
* Prompt 模板 应用关系表,记录模板和应用之间的多对多关系 Service 接口
|
||||
*
|
||||
* @author 华大大模型
|
||||
*/
|
||||
public interface PromptTemplatesApplicationsService {
|
||||
|
||||
/**
|
||||
* 创建Prompt 模板 应用关系表,记录模板和应用之间的多对多关系
|
||||
*
|
||||
* @param createReqVO 创建信息
|
||||
* @return 编号
|
||||
*/
|
||||
Long createPromptTemplatesApplications(@Valid PromptTemplatesApplicationsSaveReqVO createReqVO);
|
||||
|
||||
/**
|
||||
* 更新Prompt 模板 应用关系表,记录模板和应用之间的多对多关系
|
||||
*
|
||||
* @param updateReqVO 更新信息
|
||||
*/
|
||||
void updatePromptTemplatesApplications(@Valid PromptTemplatesApplicationsSaveReqVO updateReqVO);
|
||||
|
||||
/**
|
||||
* 删除Prompt 模板 应用关系表,记录模板和应用之间的多对多关系
|
||||
*
|
||||
* @param id 编号
|
||||
*/
|
||||
void deletePromptTemplatesApplications(Long id);
|
||||
|
||||
/**
|
||||
* 获得Prompt 模板 应用关系表,记录模板和应用之间的多对多关系
|
||||
*
|
||||
* @param id 编号
|
||||
* @return Prompt 模板 应用关系表,记录模板和应用之间的多对多关系
|
||||
*/
|
||||
PromptTemplatesApplicationsDO getPromptTemplatesApplications(Long id);
|
||||
|
||||
/**
|
||||
* 获得Prompt 模板 应用关系表,记录模板和应用之间的多对多关系分页
|
||||
*
|
||||
* @param pageReqVO 分页查询
|
||||
* @return Prompt 模板 应用关系表,记录模板和应用之间的多对多关系分页
|
||||
*/
|
||||
PageResult<PromptTemplatesApplicationsDO> getPromptTemplatesApplicationsPage(PromptTemplatesApplicationsPageReqVO pageReqVO);
|
||||
|
||||
}
|
@ -0,0 +1,74 @@
|
||||
package cn.iocoder.yudao.module.llm.service.prompttemplatesapplications;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
import javax.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.*;
|
||||
import cn.iocoder.yudao.module.llm.controller.admin.prompttemplatesapplications.vo.*;
|
||||
import cn.iocoder.yudao.module.llm.dal.dataobject.prompttemplatesapplications.PromptTemplatesApplicationsDO;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
|
||||
import cn.iocoder.yudao.module.llm.dal.mysql.prompttemplatesapplications.PromptTemplatesApplicationsMapper;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
import static cn.iocoder.yudao.module.llm.enums.ErrorCodeConstants.*;
|
||||
|
||||
/**
|
||||
* Prompt 模板 应用关系表,记录模板和应用之间的多对多关系 Service 实现类
|
||||
*
|
||||
* @author 华大大模型
|
||||
*/
|
||||
@Service
|
||||
@Validated
|
||||
public class PromptTemplatesApplicationsServiceImpl implements PromptTemplatesApplicationsService {
|
||||
|
||||
@Resource
|
||||
private PromptTemplatesApplicationsMapper promptTemplatesApplicationsMapper;
|
||||
|
||||
@Override
|
||||
public Long createPromptTemplatesApplications(PromptTemplatesApplicationsSaveReqVO createReqVO) {
|
||||
// 插入
|
||||
PromptTemplatesApplicationsDO promptTemplatesApplications = BeanUtils.toBean(createReqVO, PromptTemplatesApplicationsDO.class);
|
||||
promptTemplatesApplicationsMapper.insert(promptTemplatesApplications);
|
||||
// 返回
|
||||
return promptTemplatesApplications.getId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updatePromptTemplatesApplications(PromptTemplatesApplicationsSaveReqVO updateReqVO) {
|
||||
// 校验存在
|
||||
validatePromptTemplatesApplicationsExists(updateReqVO.getId());
|
||||
// 更新
|
||||
PromptTemplatesApplicationsDO updateObj = BeanUtils.toBean(updateReqVO, PromptTemplatesApplicationsDO.class);
|
||||
promptTemplatesApplicationsMapper.updateById(updateObj);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deletePromptTemplatesApplications(Long id) {
|
||||
// 校验存在
|
||||
validatePromptTemplatesApplicationsExists(id);
|
||||
// 删除
|
||||
promptTemplatesApplicationsMapper.deleteById(id);
|
||||
}
|
||||
|
||||
private void validatePromptTemplatesApplicationsExists(Long id) {
|
||||
if (promptTemplatesApplicationsMapper.selectById(id) == null) {
|
||||
throw exception(PROMPT_TEMPLATES_APPLICATIONS_NOT_EXISTS);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public PromptTemplatesApplicationsDO getPromptTemplatesApplications(Long id) {
|
||||
return promptTemplatesApplicationsMapper.selectById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<PromptTemplatesApplicationsDO> getPromptTemplatesApplicationsPage(PromptTemplatesApplicationsPageReqVO pageReqVO) {
|
||||
return promptTemplatesApplicationsMapper.selectPage(pageReqVO);
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,55 @@
|
||||
package cn.iocoder.yudao.module.llm.service.prompttemplatestags;
|
||||
|
||||
import java.util.*;
|
||||
import javax.validation.*;
|
||||
import cn.iocoder.yudao.module.llm.controller.admin.prompttemplatestags.vo.*;
|
||||
import cn.iocoder.yudao.module.llm.dal.dataobject.prompttemplatestags.PromptTemplatesTagsDO;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
|
||||
/**
|
||||
* Prompt 模板标签关系表,记录模板和标签之间的多对多关系 Service 接口
|
||||
*
|
||||
* @author 华大大模型
|
||||
*/
|
||||
public interface PromptTemplatesTagsService {
|
||||
|
||||
/**
|
||||
* 创建Prompt 模板标签关系表,记录模板和标签之间的多对多关系
|
||||
*
|
||||
* @param createReqVO 创建信息
|
||||
* @return 编号
|
||||
*/
|
||||
Long createPromptTemplatesTags(@Valid PromptTemplatesTagsSaveReqVO createReqVO);
|
||||
|
||||
/**
|
||||
* 更新Prompt 模板标签关系表,记录模板和标签之间的多对多关系
|
||||
*
|
||||
* @param updateReqVO 更新信息
|
||||
*/
|
||||
void updatePromptTemplatesTags(@Valid PromptTemplatesTagsSaveReqVO updateReqVO);
|
||||
|
||||
/**
|
||||
* 删除Prompt 模板标签关系表,记录模板和标签之间的多对多关系
|
||||
*
|
||||
* @param id 编号
|
||||
*/
|
||||
void deletePromptTemplatesTags(Long id);
|
||||
|
||||
/**
|
||||
* 获得Prompt 模板标签关系表,记录模板和标签之间的多对多关系
|
||||
*
|
||||
* @param id 编号
|
||||
* @return Prompt 模板标签关系表,记录模板和标签之间的多对多关系
|
||||
*/
|
||||
PromptTemplatesTagsDO getPromptTemplatesTags(Long id);
|
||||
|
||||
/**
|
||||
* 获得Prompt 模板标签关系表,记录模板和标签之间的多对多关系分页
|
||||
*
|
||||
* @param pageReqVO 分页查询
|
||||
* @return Prompt 模板标签关系表,记录模板和标签之间的多对多关系分页
|
||||
*/
|
||||
PageResult<PromptTemplatesTagsDO> getPromptTemplatesTagsPage(PromptTemplatesTagsPageReqVO pageReqVO);
|
||||
|
||||
}
|
@ -0,0 +1,74 @@
|
||||
package cn.iocoder.yudao.module.llm.service.prompttemplatestags;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
import javax.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.*;
|
||||
import cn.iocoder.yudao.module.llm.controller.admin.prompttemplatestags.vo.*;
|
||||
import cn.iocoder.yudao.module.llm.dal.dataobject.prompttemplatestags.PromptTemplatesTagsDO;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
|
||||
import cn.iocoder.yudao.module.llm.dal.mysql.prompttemplatestags.PromptTemplatesTagsMapper;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
import static cn.iocoder.yudao.module.llm.enums.ErrorCodeConstants.*;
|
||||
|
||||
/**
|
||||
* Prompt 模板标签关系表,记录模板和标签之间的多对多关系 Service 实现类
|
||||
*
|
||||
* @author 华大大模型
|
||||
*/
|
||||
@Service
|
||||
@Validated
|
||||
public class PromptTemplatesTagsServiceImpl implements PromptTemplatesTagsService {
|
||||
|
||||
@Resource
|
||||
private PromptTemplatesTagsMapper promptTemplatesTagsMapper;
|
||||
|
||||
@Override
|
||||
public Long createPromptTemplatesTags(PromptTemplatesTagsSaveReqVO createReqVO) {
|
||||
// 插入
|
||||
PromptTemplatesTagsDO promptTemplatesTags = BeanUtils.toBean(createReqVO, PromptTemplatesTagsDO.class);
|
||||
promptTemplatesTagsMapper.insert(promptTemplatesTags);
|
||||
// 返回
|
||||
return promptTemplatesTags.getId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updatePromptTemplatesTags(PromptTemplatesTagsSaveReqVO updateReqVO) {
|
||||
// 校验存在
|
||||
validatePromptTemplatesTagsExists(updateReqVO.getId());
|
||||
// 更新
|
||||
PromptTemplatesTagsDO updateObj = BeanUtils.toBean(updateReqVO, PromptTemplatesTagsDO.class);
|
||||
promptTemplatesTagsMapper.updateById(updateObj);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deletePromptTemplatesTags(Long id) {
|
||||
// 校验存在
|
||||
validatePromptTemplatesTagsExists(id);
|
||||
// 删除
|
||||
promptTemplatesTagsMapper.deleteById(id);
|
||||
}
|
||||
|
||||
private void validatePromptTemplatesTagsExists(Long id) {
|
||||
if (promptTemplatesTagsMapper.selectById(id) == null) {
|
||||
throw exception(PROMPT_TEMPLATES_TAGS_NOT_EXISTS);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public PromptTemplatesTagsDO getPromptTemplatesTags(Long id) {
|
||||
return promptTemplatesTagsMapper.selectById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<PromptTemplatesTagsDO> getPromptTemplatesTagsPage(PromptTemplatesTagsPageReqVO pageReqVO) {
|
||||
return promptTemplatesTagsMapper.selectPage(pageReqVO);
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="cn.iocoder.yudao.module.llm.dal.mysql.basemodel.BaseModelMapper">
|
||||
|
||||
<!--
|
||||
一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。
|
||||
无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。
|
||||
代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。
|
||||
文档可见:https://www.iocoder.cn/MyBatis/x-plugins/
|
||||
-->
|
||||
|
||||
</mapper>
|
@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="cn.iocoder.yudao.module.llm.dal.mysql.conversation.ConversationMapper">
|
||||
|
||||
<!--
|
||||
一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。
|
||||
无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。
|
||||
代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。
|
||||
文档可见:https://www.iocoder.cn/MyBatis/x-plugins/
|
||||
-->
|
||||
|
||||
</mapper>
|
@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="cn.iocoder.yudao.module.llm.dal.mysql.dataprocesstask.DataProcessTaskMapper">
|
||||
|
||||
<!--
|
||||
一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。
|
||||
无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。
|
||||
代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。
|
||||
文档可见:https://www.iocoder.cn/MyBatis/x-plugins/
|
||||
-->
|
||||
|
||||
</mapper>
|
@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="cn.iocoder.yudao.module.llm.dal.mysql.datasetanswer.DatasetAnswerMapper">
|
||||
|
||||
<!--
|
||||
一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。
|
||||
无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。
|
||||
代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。
|
||||
文档可见:https://www.iocoder.cn/MyBatis/x-plugins/
|
||||
-->
|
||||
|
||||
</mapper>
|
@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="cn.iocoder.yudao.module.llm.dal.mysql.datasetfiles.DatasetFilesMapper">
|
||||
|
||||
<!--
|
||||
一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。
|
||||
无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。
|
||||
代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。
|
||||
文档可见:https://www.iocoder.cn/MyBatis/x-plugins/
|
||||
-->
|
||||
|
||||
</mapper>
|
@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="cn.iocoder.yudao.module.llm.dal.mysql.datasetquestion.DatasetQuestionMapper">
|
||||
|
||||
<!--
|
||||
一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。
|
||||
无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。
|
||||
代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。
|
||||
文档可见:https://www.iocoder.cn/MyBatis/x-plugins/
|
||||
-->
|
||||
|
||||
</mapper>
|
@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="cn.iocoder.yudao.module.llm.dal.mysql.finetuning.FineTuningMapper">
|
||||
|
||||
<!--
|
||||
一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。
|
||||
无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。
|
||||
代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。
|
||||
文档可见:https://www.iocoder.cn/MyBatis/x-plugins/
|
||||
-->
|
||||
|
||||
</mapper>
|
@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="cn.iocoder.yudao.module.llm.dal.mysql.finetuningloss.FineTuningLossMapper">
|
||||
|
||||
<!--
|
||||
一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。
|
||||
无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。
|
||||
代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。
|
||||
文档可见:https://www.iocoder.cn/MyBatis/x-plugins/
|
||||
-->
|
||||
|
||||
</mapper>
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user