| | |
| | | */ |
| | | public void chatMessageStop(String task_id, CloudCallBeak<Boolean> cloudCallBeak) { |
| | | JsonObject json = new JsonObject(); |
| | | if (!TextUtils.isEmpty(task_id)) { |
| | | json.addProperty("task_id", task_id); |
| | | } |
| | | // if (!TextUtils.isEmpty(task_id)) { |
| | | // json.addProperty("task_id", task_id); |
| | | // } |
| | | json.addProperty("user", UserConfigManage.getInstance().getUserId()); |
| | | ChatStreamClient.ChatMode chatMode = new ChatStreamClient.ChatMode(); |
| | | chatMode.data = json; |
| | | chatMode.stream = false; |
| | | chatMode.isGet = false; |
| | | chatMode.url = "/chat-messages/:task_id/stop"; |
| | | chatMode.url = "/chat-messages/"+task_id+"/stop"; |
| | | ChatStreamClient.getInstance().streamChat(chatMode, new ChatStreamClient.ChatCallback() { |
| | | @Override |
| | | public void onMessage(String content) { |
| | |
| | | //一次性回复 |
| | | if (cloudCallBeak != null) { |
| | | // boolean isSuccess = fullMessage.contains("\"success\":true"); |
| | | boolean isSuccess = fullMessage.contains("true"); |
| | | boolean isSuccess = fullMessage.contains("\"result\": \"success\""); |
| | | cloudCallBeak.onSuccess(isSuccess); |
| | | } |
| | | } |