.setBodyEntity(jsonRequestBody, ENCODING, MediaType.APPLICATION_JSON) .send(); log.debug("response: {}", httpResponse.getContentAsString()); final List<String> output = getOutputText(httpResponse.getContentAsString()); final String state = getConversationState(httpResponse.getContentAsString()); if (state != null && !state.equals("READY")) { conversationIdCache.remove(senderId);
.setBodyEntity(jsonRequestBody, ENCODING, MediaType.APPLICATION_JSON) .send(); log.debug("response: {}", httpResponse.getContentAsString()); final List<Output> outputs = getOutputText(httpResponse.getContentAsString()); final List<Map<String, String>> quickReplies = getQuickReplies(httpResponse.getContentAsString()); final String state = getConversationState(httpResponse.getContentAsString()); if (state != null && !state.equals("READY")) { conversationIdCache.remove(senderId);
.setTimeout(EDDI_TIMEOUT, TimeUnit.MILLISECONDS) .send(); List<String> botids = extractBotIdsFromResponse(httpResponse.getContentAsString()); for (String botId : botids) { Integer version = getLatestDeployedBotVersion(botId);
final String responseBody = response.getContentAsString(); String actualContentType = response.getHttpHeader().get(CONTENT_TYPE); if (actualContentType != null) {
@Override public ConversationDataResponse doExternalCall(URI url, ConversationDataRequest request, long timeoutInMillis) { ConversationDataResponse dataResponse = new ConversationDataResponse(); try { String jsonRequestBody = jsonSerialization.serialize(request); IResponse httpResponse = httpClient.newRequest(url, IHttpClient.Method.POST) .setUserAgent(AI_LABS_USER_AGENT) .setTimeout(timeoutInMillis, TimeUnit.MILLISECONDS) .setBodyEntity(jsonRequestBody, ENCODING, MediaType.APPLICATION_JSON) .send(); dataResponse.setHttpCode(httpResponse.getHttpCode()); dataResponse.setHeader(httpResponse.getHttpHeader()); ConversationDataResponseHolder responseHolder = jsonSerialization.deserialize(httpResponse.getContentAsString(), ConversationDataResponseHolder.class); dataResponse.setConversationMemorySnapshot(responseHolder.getConversationMemorySnapshot()); } catch (IRequest.HttpRequestException | IOException e) { log.error(e.getLocalizedMessage(), e); } return dataResponse; } }