| | |
| | | return tranReq.returnText(result); |
| | | } |
| | | |
| | | public ModelAndView weChatTest(SMTAIServerRequest tranReq) throws Exception { |
| | | String question = "冰箱是什么"; |
| | | tranReq.setAIQuestion(question); |
| | | tranReq.setTextResultMode(); |
| | | |
| | | Set<String> setAgentGroup = new HashSet<>(); |
| | | String weixinGroupId = |
| | | (String) SMTAIServerApp.getApp().getGlobalConfig("weixin.group_id", false); |
| | | setAgentGroup.add(weixinGroupId); |
| | | |
| | | SMTJavaAIChat.questionChat("aliyun", setAgentGroup, "业务场景", question, null, false, tranReq); |
| | | String text = tranReq.getTextResult(); |
| | | |
| | | return tranReq.returnText(text); |
| | | } |
| | | // public ModelAndView weChatTest(SMTAIServerRequest tranReq) throws Exception { |
| | | // String question = "冰箱是什么"; |
| | | // tranReq.setAIQuestion(question); |
| | | // tranReq.setTextResultMode(); |
| | | // |
| | | // Set<String> setAgentGroup = new HashSet<>(); |
| | | // String weixinGroupId = |
| | | // (String) SMTAIServerApp.getApp().getGlobalConfig("weixin.group_id", false); |
| | | // setAgentGroup.add(weixinGroupId); |
| | | // |
| | | // SMTJavaAIChat.questionChat("aliyun", setAgentGroup, "业务场景", question, null, false, tranReq); |
| | | // String text = tranReq.getTextResult(); |
| | | // |
| | | // return tranReq.returnText(text); |
| | | // } |
| | | |
| | | /** ai回复 */ |
| | | private String callAIForAnswerQuestion(String question, SMTAIServerRequest tranReq) |
| | | throws Exception { |
| | | tranReq.setAIQuestion(question); |
| | | tranReq.setTextResultMode(); |
| | | |
| | | Set<String> setAgentGroup = new HashSet<>(); |
| | | String weixinGroupId = |
| | | (String) SMTAIServerApp.getApp().getGlobalConfig("weixin.group_id", false); |
| | | setAgentGroup.add(weixinGroupId); |
| | | |
| | | SMTJavaAIChat.questionChat("aliyun", setAgentGroup, "业务场景", question, null, false, tranReq); |
| | | return tranReq.getTextResult(); |
| | | } |
| | | // private String callAIForAnswerQuestion(String question, SMTAIServerRequest tranReq) |
| | | // throws Exception { |
| | | // tranReq.setAIQuestion(question); |
| | | // tranReq.setTextResultMode(); |
| | | // |
| | | // Set<String> setAgentGroup = new HashSet<>(); |
| | | // String weixinGroupId = |
| | | // (String) SMTAIServerApp.getApp().getGlobalConfig("weixin.group_id", false); |
| | | // setAgentGroup.add(weixinGroupId); |
| | | // |
| | | // SMTJavaAIChat.questionChat("aliyun", setAgentGroup, "业务场景", question, null, false, tranReq); |
| | | // return tranReq.getTextResult(); |
| | | // } |
| | | |
| | | /** 二次回复 */ |
| | | public void aiReplyToTheUserASecondTime(String answer, String fromUserName, String abortID) |