| | |
| | | import cc.mrbird.febs.ai.service.AiProductRoleService; |
| | | import cc.mrbird.febs.ai.service.AiService; |
| | | import cc.mrbird.febs.ai.service.AiTalkItemService; |
| | | import cc.mrbird.febs.ai.strategy.enumerates.LlmStrategyContextEnum; |
| | | import cc.mrbird.febs.common.entity.FebsResponse; |
| | | import cc.mrbird.febs.mall.entity.DataDictionaryCustom; |
| | | import cc.mrbird.febs.mall.mapper.DataDictionaryCustomMapper; |
| | | import cn.hutool.core.collection.CollUtil; |
| | | import cn.hutool.core.util.StrUtil; |
| | | import cn.hutool.json.JSONUtil; |
| | |
| | | private final AiProductRoleService aiProductRoleService; |
| | | private final ObjectMapper objectMapper; |
| | | private final AiTalkItemService aiTalkItemService; |
| | | private final DataDictionaryCustomMapper dataDictionaryCustomMapper; |
| | | |
| | | @Value("${ai.service.ak}") |
| | | private String ak; |
| | |
| | | } |
| | | |
| | | @Override |
| | | public Integer getSystemSetAiType() { |
| | | Integer type = 2; |
| | | DataDictionaryCustom dataDictionaryCustom = dataDictionaryCustomMapper.selectDicDataByTypeAndCode( |
| | | LlmStrategyContextEnum.LLM_STRATEGY.getCode(), |
| | | LlmStrategyContextEnum.LLM_STRATEGY.getCode() |
| | | ); |
| | | if (dataDictionaryCustom != null) { |
| | | type = Integer.parseInt(dataDictionaryCustom.getValue()); |
| | | } |
| | | return type; |
| | | } |
| | | |
| | | @Override |
| | | public AiResponse start(List<AiMessage> aiMessageDtoList,Integer type,String productRoleId, String content, String question) { |
| | | if (!StringUtils.hasText(productRoleId)) { |
| | | log.warn("productRoleId 不能为空"); |