wit-ai / wit

Natural Language Interface for apps and devices
https://wit.ai/
936 stars 91 forks source link

Bug: In response, action is not running when any flow other than 'response to input' is implemented #2599

Closed adhilmunna closed 1 year ago

adhilmunna commented 1 year ago

When response is immediately connected to input, action runs ok.

but when response is connected to any module other than input, say, recontext or decision, action fails to run and sometimes stalls the entire bot

@yuzh174

adhilmunna commented 1 year ago

@harisvsulaiman

yuzh174 commented 1 year ago

What is the app ID?

adhilmunna commented 1 year ago

What is the app ID?

@yuzh174 we had to deploy bot to production hence removed all response to response flows.

Should i create one and share app id with you?

yuzh174 commented 1 year ago

It would be good if you have a repro so we could investigate. Technically, you don't need to always connect responses directly to inputs.

adhilmunna commented 1 year ago

It would be good if you have a repro so we could investigate. Technically, you don't need to always connect responses directly to inputs.

@yuzh174 ok then, i will create a separate bot with two branches. one with working scenario and another one with issue and then let you know here.

adhilmunna commented 1 year ago

228837596333399

@yuzh174 here is the app id

yuzh174 commented 1 year ago

I tested your app. This is what I get below. Is this expected output? I don't see error. Could you share repro steps if you see errors.

yuzh@yuzh-mp fbsource % curl -XPOST \                         
  -H "Authorization: Bearer $TOKEN" \                         
  'https://api.wit.ai/event?v=20230319&session_id=draft_defaultqmn&context_map=%7B%7D&tag=play%241528077047719170' \
  -d '{"type":"message","message":"Working"}'    
{
  "context_map": {},
  "expects_input": true,
  "is_final": true,
  "response": {
    "text": "Type working to check working flow. And not working for not working flow"
  }
}%                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            yuzh@yuzh-mp fbsource % curl -XPOST \
  -H "Authorization: Bearer $TOKEN" \
  'https://api.wit.ai/event?v=20230319&session_id=draft_defaultqmn&context_map=%7B%7D&tag=play%241528077047719170' \
  -d '{"type":"message","message":"Not working"}'
{
  "context_map": {},
  "response": {
    "text": "This is an error flow when response is split into 2 and action is run in immediately succeeding response module. It doesn't work if there is any other module than input module between 2 responses. In the wit inbrowser debug chat, it works fine. But when plugged to an external app, it fails and flow breaks."
  }
}
{
  "action": "sample_action",
  "context_map": {},
  "response": {
    "text": "Action runs with this response"
  }
}
{
  "context_map": {},
  "expects_input": true,
  "is_final": true,
  "response": {
    "text": "This text must be displayed as an indicator of flow working properly.\n\n\n\"type working to check working flow. And not working for not working flow\""
  }
}%