| | |
| | | @GetMapping("/intent") |
| | | public String intent(@RequestParam(value = "message",defaultValue = "Hi") String message){ |
| | | String json = okHttpUtil.getMessage(intent+"="+message); |
| | | |
| | | return json ; |
| | | Map<String,String> hashMap = new HashMap<>() ; |
| | | iteraJson(json,hashMap); |
| | | return JSON.toJSON(hashMap).toString() ; |
| | | } |
| | | public boolean iteraJson(String str, Map res){ |
| | | if(str.toString().indexOf(":") == -1){ |
| | |
| | | }else{ |
| | | json = hashMap.put("content", chatModel.call("请用中文回答如下问题,如果有地名出现,回到内容包括经纬度并使用json返回,"+message)); |
| | | } |
| | | return json ; |
| | | return JSON.toJSON(hashMap).toString() ; |
| | | |
| | | |
| | | } |