|
|
|
@ -14,9 +14,7 @@ import lombok.RequiredArgsConstructor;
|
|
|
|
|
import org.dromara.ai.domain.bo.AiChatMessageBo;
|
|
|
|
|
import org.dromara.ai.domain.bo.AiChatMessageTopicBo;
|
|
|
|
|
import org.dromara.ai.domain.bo.AiModelBo;
|
|
|
|
|
import org.dromara.ai.domain.bo.AiModelCategoryBo;
|
|
|
|
|
import org.dromara.ai.domain.vo.AiChatMessageVo;
|
|
|
|
|
import org.dromara.ai.domain.vo.AiModelCategoryVo;
|
|
|
|
|
import org.dromara.ai.domain.vo.AiModelVo;
|
|
|
|
|
import org.dromara.ai.knowledge.vectorization.factory.EmbeddingServiceFactory;
|
|
|
|
|
import org.dromara.ai.knowledge.vectorization.process.IEmbeddingProcessor;
|
|
|
|
@ -54,8 +52,6 @@ import java.util.List;
|
|
|
|
|
@RequestMapping("/assistant")
|
|
|
|
|
public class AiAssistantController extends BaseController {
|
|
|
|
|
|
|
|
|
|
private final IAiModelCategoryService aiModelCategoryService;
|
|
|
|
|
|
|
|
|
|
private final AIProviderProcessorFactory aiProviderProcessorFactory;
|
|
|
|
|
|
|
|
|
|
private final EmbeddingServiceFactory embeddingServiceFactory;
|
|
|
|
@ -159,87 +155,4 @@ public class AiAssistantController extends BaseController {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 查询模型分类列表
|
|
|
|
|
*/
|
|
|
|
|
@SaCheckPermission("ai:modelCategory:list")
|
|
|
|
|
@GetMapping("/list")
|
|
|
|
|
public TableDataInfo<AiModelCategoryVo> list(AiModelCategoryBo bo, PageQuery pageQuery) {
|
|
|
|
|
return aiModelCategoryService.queryPageList(bo, pageQuery);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 导出模型分类列表
|
|
|
|
|
*/
|
|
|
|
|
@SaCheckPermission("ai:modelCategory:export")
|
|
|
|
|
@Log(title = "模型分类", businessType = BusinessType.EXPORT)
|
|
|
|
|
@PostMapping("/export")
|
|
|
|
|
public void export(AiModelCategoryBo bo, HttpServletResponse response) {
|
|
|
|
|
List<AiModelCategoryVo> list = aiModelCategoryService.queryList(bo);
|
|
|
|
|
ExcelUtil.exportExcel(list, "模型分类", AiModelCategoryVo.class, response);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 获取模型分类详细信息
|
|
|
|
|
*
|
|
|
|
|
* @param modelCategoryId 主键
|
|
|
|
|
*/
|
|
|
|
|
@SaCheckPermission("ai:modelCategory:query")
|
|
|
|
|
@GetMapping("/{modelCategoryId}")
|
|
|
|
|
public R<AiModelCategoryVo> getInfo(@NotNull(message = "主键不能为空")
|
|
|
|
|
@PathVariable Long modelCategoryId) {
|
|
|
|
|
return R.ok(aiModelCategoryService.queryById(modelCategoryId));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 新增模型分类
|
|
|
|
|
*/
|
|
|
|
|
@SaCheckPermission("ai:modelCategory:add")
|
|
|
|
|
@Log(title = "模型分类", businessType = BusinessType.INSERT)
|
|
|
|
|
@RepeatSubmit()
|
|
|
|
|
@PostMapping()
|
|
|
|
|
public R<Void> add(@Validated(AddGroup.class) @RequestBody AiModelCategoryBo bo) {
|
|
|
|
|
return toAjax(aiModelCategoryService.insertByBo(bo));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 修改模型分类
|
|
|
|
|
*/
|
|
|
|
|
@SaCheckPermission("ai:modelCategory:edit")
|
|
|
|
|
@Log(title = "模型分类", businessType = BusinessType.UPDATE)
|
|
|
|
|
@RepeatSubmit()
|
|
|
|
|
@PutMapping()
|
|
|
|
|
public R<Void> edit(@Validated(EditGroup.class) @RequestBody AiModelCategoryBo bo) {
|
|
|
|
|
return toAjax(aiModelCategoryService.updateByBo(bo));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 下拉框查询模型分类列表
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
@GetMapping("/getAiModelCategoryList")
|
|
|
|
|
public R<List<AiModelCategoryVo>> getAiModelCategoryList(AiModelCategoryBo bo) {
|
|
|
|
|
List<AiModelCategoryVo> list = aiModelCategoryService.queryList(bo);
|
|
|
|
|
return R.ok(list);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|