|
|
@@ -738,8 +738,16 @@ public class AiHookServiceImpl implements AiHookService {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
- aiEventProcess(sender, uid, role, contentKh, user, fastGptChatSession, serverId,qwExternalContacts);
|
|
|
+ if(isNewVersion) {
|
|
|
+ Gson gson = new Gson();
|
|
|
+ FastGptChatConversation fastGptChatConversation = gson.fromJson(contentKh, FastGptChatConversation.class);
|
|
|
+ String eventInfo = fastGptChatConversation.getEventInfo();
|
|
|
+ if(eventInfo != null && !eventInfo.isEmpty()){
|
|
|
+ aiEventProcess(sender, uid, role, eventInfo, user, fastGptChatSession, serverId, qwExternalContacts);
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ aiEventProcess(sender, uid, role, contentKh, user, fastGptChatSession, serverId, qwExternalContacts);
|
|
|
+ }
|
|
|
|
|
|
|
|
|
if (result.isArtificial()){
|
|
|
@@ -754,10 +762,12 @@ public class AiHookServiceImpl implements AiHookService {
|
|
|
private void addUserInfoNew(String word,FastGptChatSession fastGptChatSession) {
|
|
|
com.alibaba.fastjson.JSONObject jsonObject = com.alibaba.fastjson.JSONObject.parseObject(word);
|
|
|
String userInfo = jsonObject.getString("userInfo");
|
|
|
- FastGptChatSession chatSession = new FastGptChatSession();
|
|
|
- chatSession.setSessionId(fastGptChatSession.getSessionId());
|
|
|
- chatSession.setUserInfo(userInfo);
|
|
|
- fastGptChatSessionMapper.updateFastGptChatSession(chatSession);
|
|
|
+ if(userInfo != null && !userInfo.isEmpty()){
|
|
|
+ FastGptChatSession chatSession = new FastGptChatSession();
|
|
|
+ chatSession.setSessionId(fastGptChatSession.getSessionId());
|
|
|
+ chatSession.setUserInfo(userInfo);
|
|
|
+ fastGptChatSessionMapper.updateFastGptChatSession(chatSession);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
private void sendImgMsg(String contentKh, Long sender, String uuid, Long serverId) {
|