dialogflow-android-client icon indicating copy to clipboard operation
dialogflow-android-client copied to clipboard

sending payload from V1 SDK

Open skeer00 opened this issue 7 years ago • 1 comments

How can I send payload and lat, lon from dialogflow android sdk?

skeer00 avatar Aug 24 '18 05:08 skeer00

Update

I am able to pass payload when I use the code like below,

final AIRequest aiRequest = new AIRequest(); AIOriginalRequest aiO = new AIOriginalRequest(); HashMap<String, String> hm = new HashMap<String, String>(); hm.put("element_1", "8888"); hm.put("element_2", "abcd"); aiO.setData(hm); aiRequest.setOriginalRequest(aiO); aiRequest.setQuery("find Cheese"); and I am getting this in server as below,

{ "responseId": "ddsds-qwq-qwqwq-wqwqwq", "session": "<>", "queryResult": { "languageCode": "en", "intentDetectionConfidence": "0.93", "allRequiredParamsPresent": "true", "parameters": { "item": "Cheese" }, "fulfillmentMessages": [{ "text": { "text": [""] } }], "queryText": "find Cheese", "intent": { "name": "<>", "displayName": "item-req" } }, "originalDetectIntentRequest": { "payload": { "element_2": "abcd", "element_1": "8888" } } } But as I am using AIService and using startListening method of that, I am not able to set the AIRequest and setOriginalRequest. There is no way to set OriginalRequest if are using AIService and startListening. The Dialogflow sdk is automatically doing this.

Any one faced such situation or solved this?

skeer00 avatar Aug 28 '18 11:08 skeer00