聊天接口

This commit is contained in:
zhangtao 2024-12-31 11:05:40 +08:00
parent 90e4626b95
commit 3a8969499f

View File

@ -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;
}
}