Commit cd6d79b8 authored by alex yao's avatar alex yao

feat: 模型信息搜索 v2

parent 42911469
......@@ -72,6 +72,11 @@ public interface AgentApplicationInfoRest extends BaseRest {
*/
BizAgentApplicationLargeModelListDto getLargeModelInfo(@RequestParam String query) throws Exception;
/**
* 查询模型信息_v2
*/
BizAgentApplicationLargeModelListV2Dto getLargeModelInfoV2(@RequestParam String query) throws Exception;
/**
* 角色指令AI生成
......
......@@ -345,6 +345,41 @@ public class AgentApplicationInfoRestImpl implements AgentApplicationInfoRest {
return result;
}
@Override
public BizAgentApplicationLargeModelListV2Dto getLargeModelInfoV2(String query) throws Exception {
Assert.notNull(query);
BizAgentApplicationLargeModelListEntity bizAgentApplicationLargeModelListEntity = new BizAgentApplicationLargeModelListEntity();
bizAgentApplicationLargeModelListEntity.setModelNickName(query);
List<BizAgentApplicationLargeModelListEntity> entities = bizAgentApplicationLargeModelListService.findByExample(bizAgentApplicationLargeModelListEntity, null);
if (CollectionUtils.isEmpty(entities)) {
throw new I18nMessageException("exception/model.not.exist");
}
BizAgentApplicationLargeModelListEntity entity = entities.get(0);
BizPointDeductionRulesEntity bizPointDeductionRulesEntity = new BizPointDeductionRulesEntity();
bizPointDeductionRulesEntity.setRuleType(RuleType.MODEL.getRuleType());
bizPointDeductionRulesEntity.setRelationId(query);
bizPointDeductionRulesEntity.setIsDeleted(CommonConstant.IsDeleted.N);
List<BizPointDeductionRulesEntity> rulesEntityList = bizPointDeductionRulesService.findByExample(bizPointDeductionRulesEntity, null);
BizAgentApplicationLargeModelListV2Dto result = new BizAgentApplicationLargeModelListV2Dto();
List<LargeModelInfo> largeModelInfos = new ArrayList<>();
LargeModelInfo largeModelInfo = new LargeModelInfo();
largeModelInfo.setModelNickName(entity.getModelNickName());
Long pointNumber = 0L;
if (CollectionUtils.isNotEmpty(rulesEntityList)) {
pointNumber = rulesEntityList.get(0).getNumber();
}
BigDecimal points = new BigDecimal(pointNumber).divide(new BigDecimal(100), 2, BigDecimal.ROUND_HALF_UP);
largeModelInfo.setPoints(points);
largeModelInfos.add(largeModelInfo);
result.setModels(largeModelInfos);
result.setOwner(entity.getOwner());
result.setIcon(entity.getIconUrl());
return result;
}
@Override
public void createAgentSystem(AgentApplicationGCDto dto, HttpServletResponse response) throws Exception {
Assert.notNull(dto.getInput());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment