diff --git a/yudao-module-llm/yudao-module-llm-biz/src/main/java/cn/iocoder/yudao/module/llm/service/conversation/ConversationServiceImpl.java b/yudao-module-llm/yudao-module-llm-biz/src/main/java/cn/iocoder/yudao/module/llm/service/conversation/ConversationServiceImpl.java index e99b0376f..2ce9801be 100644 --- a/yudao-module-llm/yudao-module-llm-biz/src/main/java/cn/iocoder/yudao/module/llm/service/conversation/ConversationServiceImpl.java +++ b/yudao-module-llm/yudao-module-llm-biz/src/main/java/cn/iocoder/yudao/module/llm/service/conversation/ConversationServiceImpl.java @@ -126,7 +126,10 @@ public class ConversationServiceImpl implements ConversationService { if (modelCompletionsRespVO == null) { throw exception(MODEL_COMPLETIONS_ERROR); } + ChatRespVO chatRespVO = BeanUtils.toBean(chatReqVO, ChatRespVO.class); + chatRespVO.setResponse(modelCompletionsRespVO.getAnswer()); + // 将聊天记录放入缓存 stringRedisTemplate.opsForList().rightPush(CHAT_HIStORY_REDIS_KEY + ":" + chatReqVO.getUuid(), JsonUtils.toJsonString(message)); - return null; + return chatRespVO; } } \ No newline at end of file