dialogflow / dialogflow-android-client

Android SDK for Dialogflow
https://dialogflow.com
Apache License 2.0
574 stars 270 forks source link

sending payload from V1 SDK #100

Open skeer00 opened 6 years ago

skeer00 commented 6 years ago

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

skeer00 commented 6 years ago

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?