Usert enter random message and continue with predifined utter

Hi,

I will share the part of the story where the problem appears. Because the Story is quite long.

Is good to know that it comes after a checkin using Reminder Schedule action. And you will see the random form, and the problem occurs in the first random form, that it get filled with the same answer of utter_positive_answer.

## S2 1
> checkin_to_s2
    - utter_q_perc_last_time
* utter_positive_answer
    - utter_we_had_it
    - utter_perc_inner_outer
    - utter_perc_your
    - utter_perc_own
    - form_random02
    - form{"name": "form_random02"}
    - form{"name": null}
    - action_reset_slot02
    - utter_appreciation_danke
    - utter_strength_prompt
    - form_random02
    - form{"name": "form_random02"}
    - form{"name": null}
    - action_reset_slot02
> fork_4s2

The there is not a intent with the random_answer at all, because it can be anything, this is why we use FormAction with with slot_mappings as self.from_text, here is part the action code:

     @staticmethod
      def required_slots(tracker: Tracker) -> List[Text]:

         return ["random_answer"]

      def slot_mappings(self) -> Dict[Text, Union[Dict, List[Dict]]]:

         return {
              "random_answer": [self.from_text()],
         }

Let me know if it is necessary to have more information. thanks and all the best

Hi Stephen

thanks for formatting the text properly.

Let me know if I could provide more information to help debug this problem.

all the best

The story looks far too complex and if you’re other stories are this complex and think the result is very hard to predict.

Start again with one or two simple stories.

## Simple form story
* utter_positive_answer
    - utter_we_had_it
    - form_random02
    - form{"name": "form_random02"}
    - form{"name": null}
    - utter_appreciation_danke

Hi Stephens,

thanks for the reply.

Being complex or no, the conversations are working when using Webchat (socket.io) or Facebook Messenger. The problem resides on Slack Channel only.

And we can not make major changes in the conversation since it is working in Rasa using other channels, we have to deliver the same also in Slack.

How we can find out why Slack is not working how it should?

thanks and all the best

Hi @alebeta90,

let’s try the following: Can you please have the conversation both, with the slack connector and one working of the working connectors, and when you passed the flow you retrieve the tracker via this endpoint HTTP API . Then we can compare whether the events in the tracker are actually looking differently.

Is good to know that it comes after a checkin using Reminder Schedule action.

Might be a wild guess but an action triggered by a reminder might confuse the core predictions because the earlier state is kind of random. We are gonna release Rasa OSS 1.7 tomorrow which let’s you have reminders which trigger intents instead of action, which does not lead to failing predictions anymore because you can simply write a story for it.

Hi @Tobias_Wochinger

here is the output from the API call

Slack: Slack Tracker It started at utter: utter_q_perc_last_time There the bot is asking a question and it is not waiting for the answer. In that case that question is not inside of the random answer form, is a question that is expecting a positive or negative answer.

Socketio: SocketIO Tracker Here everything went well at that point of the conversation

And thanks for letting me know about the new version of Rasa OSS 1.7. We can check it out tomorrow and see how it goes.

thanks for all your support

Hi @Tobias_Wochinger

I had been checking the Tracker while writing to the bot in Slack. I could see the follow behavior:

This is a screenshot when the bot start misbehaving

After the bot is coming back using the reminder, it make it first question(not FormAction) and it wait for my answer, after I entered my answer, it start using that answer as the slot for the FormAction(random_answer)

Here are the slots

 "slots": {
    "jump_s2": null,
    "jump_s3": null,
    "jump_s4": null,
    "name": "Alejandro",
    "random_answer": "ja",
    "random_answer02": null,
    "requested_slot": "random_answer02",
    "timeSchedule": "16h"
  },

It is really strange, that it is filling the slot random_answer and it is using it for those FormAction, because my FormAction I set in that part of the chat is called form_random02 and the slot defined is random_answer02(the one that in the slots appear as null). It make a no sense, that the bot is setting the slot from a utter that it should not collect that slot and the slot should not apply for the next FormActions because we are note using that slot.

Here is the tracker at the moment the bot start responding without real user input:

    {
      "event": "action",
      "timestamp": 1580375008.924567461,
      "name": "utter_q_perc_last_time",
      "policy": "policy_0_AugmentedMemoizationPolicy",
      "confidence": 1.0
    },
    {
      "event": "bot",
      "timestamp": 1580375008.924582243,
      "text": "Wir hatten doch über Selbstwahrnehmung gesprochen. Stimmts?",
      "data": {
        "elements": null,
        "quick_replies": null,
        "buttons": null,
        "attachment": null,
        "image": null,
        "custom": null
      },
      "metadata": {}
    },
    {
      "event": "action",
      "timestamp": 1580375010.0966749191,
      "name": "action_listen",
      "policy": "policy_0_AugmentedMemoizationPolicy",
      "confidence": 1.0
    },
    {
      "event": "user",
      "timestamp": 1580375010.5788779259,
      "text": "ja",
      "parse_data": {
        "intent": {
          "name": "utter_positive_answer",
          "confidence": 0.9783334732
        },
        "entities": [],
        "intent_ranking": [
          {
            "name": "utter_positive_answer",
            "confidence": 0.9783334732
          },
          {
            "name": "utter_like_about_me",
            "confidence": 0.0035955023
          },
          {
            "name": "help_info",
            "confidence": 0.0029727437
          },
          {
            "name": "utter_appreciation",
            "confidence": 0.0022979407
          },
          {
            "name": "utter_was",
            "confidence": 0.0021599769
          },
          {
            "name": "utter_time_0_24_s4",
            "confidence": 0.0018846876
          },
          {
            "name": "utter_im_happy_if",
            "confidence": 0.0015305708
          },
          {
            "name": "utter_it_was_bad",
            "confidence": 0.0014666431
          },
          {
            "name": "utter_not_thankful",
            "confidence": 0.0011141842
          },
          {
            "name": "utter_email",
            "confidence": 0.0008962922
          }
        ],
        "text": "ja"
      },
      "input_channel": "slack",
      "message_id": "cceb6c35ccb14c91a3966eb5682e50a0",
      "metadata": {}
    },

At this point we have this second utter(it is not a FormAction) and it is taking the answer inside of slot random_answer.

So far I can not find a relation why it is auto responding that way. And why utters are taking that slot as an answer.

Hope this information can help to find a solution to the problem

But their is still an active form, right? We released Rasa 1.7 yesterday which let’s you trigger intents instead of actions (see the docs here ). This would also let you write stories for this specific path. I also asked the developer of this new feature if it could help. Currently waiting for feedback.

Hi @Tobias_Wochinger

thank you very much for your quick answer.

The Form should not be active, because we are closing the form right after the user gives an input.

Right now I’m figuring out how to use the new Reminder and talking with the friends in the Rasa Contributors Slack server. I want to give a change to that, in order to check if it can be a solution with this problem that we have with the Slack Channel

The docs so far are not so clear and there are not live examples(understandable because the feature is new). But I got some guidance in Slack. Let see how it works :slight_smile:

Thanks a lot

Hi @Tobias_Wochinger

after the implementation of the new trigger intents for reminders schedule, the conversation still have the same behavior in Slack conversation. It is possible to have a look at how the Slack channel is working? because it is really wierd we are having such a problems just with Slack.

All the best

@alebeta90

Can you please override the form action as follows:

def run(self,dispatcher, tracker, domain):
    print("####DEBUGGING####")
    print("Slot: " + str(tracker.slots)). # logging all slots here
    print("####DEBUGGING####")
    return super().run(dispatcher, tracker, domain). # call the function of the superclass to keep the regular form behavior

and send the output again (the output will show in the logs of the action server)

Hi Tobi,

thanks for the answer. I’m performing the test right now, and will come to you as soon as possible.

thanks

And can you please also run with rasa --debug and check if there are any other logs in the action server and in Rasa Open Source ? Seems really weird since everything seems to work fine, except that the form does not run after utter_perc_own

Hi Tobi,

here is the output from Action Server

2020-02-24 12:28:40 INFO     rasa_sdk.endpoint  - Starting action endpoint server...


2020-02-24 12:28:40 INFO     rasa_sdk.executor  - Registered function for 'action_schedule_checkin'.


2020-02-24 12:28:40 INFO     rasa_sdk.executor  - Registered function for 'action_schedule_checkin2'.

2020-02-24 12:28:40 INFO     rasa_sdk.executor  - Registered function for 'action_checkin2'.
2020-02-24 12:28:40 INFO     rasa_sdk.executor  - Registered function for 'action_schedule_checkin3'.
2020-02-24 12:28:40 INFO     rasa_sdk.executor  - Registered function for 'action_checkin3'.
2020-02-24 12:28:40 INFO     rasa_sdk.executor  - Registered function for 'action_reset_slot'.
2020-02-24 12:28:40 INFO     rasa_sdk.executor  - Registered function for 'action_reset_slot02'.
2020-02-24 12:28:40 INFO     rasa_sdk.executor  - Registered function for 'form_random01'.
2020-02-24 12:28:40 INFO     rasa_sdk.executor  - Registered function for 'form_random02'.
Exception occurred while handling uri: 'http://action-server:5055/webhook'
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/sanic/app.py", line 942, in handle_request
    response = await response
  File "/app/rasa_sdk/endpoint.py", line 86, in webhook
    result = await executor.run(action_call)
  File "/app/rasa_sdk/executor.py", line 286, in run
    validated_events = self.validate_events(events, action_name)
  File "/app/rasa_sdk/executor.py", line 233, in validate_events
    for e in events:
TypeError: 'coroutine' object is not iterable
/usr/local/lib/python3.6/site-packages/sanic/app.py:973: RuntimeWarning: coroutine 'FormAction.run' was never awaited
  "An error occurred while handling an error", status=50
Exception occurred while handling uri: 'http://action-server:5055/webhook
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/sanic/app.py", line 942, in handle_request
    response = await response
  File "/app/rasa_sdk/endpoint.py", line 86, in webhook
    result = await executor.run(action_call)
  File "/app/rasa_sdk/executor.py", line 286, in run
    validated_events = self.validate_events(events, action_name)
  File "/app/rasa_sdk/executor.py", line 233, in validate_events
    for e in events:
TypeError: 'coroutine' object is not iterable
Exception occurred while handling uri: 'http://action-server:5055/webhook'
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/sanic/app.py", line 942, in handle_request
    response = await response
  File "/app/rasa_sdk/endpoint.py", line 86, in webhook
    result = await executor.run(action_call)
  File "/app/rasa_sdk/executor.py", line 286, in run
    validated_events = self.validate_events(events, action_name)
  File "/app/rasa_sdk/executor.py", line 233, in validate_events
    for e in events:
TypeError: 'coroutine' object is not iterable
Exception occurred while handling uri: 'http://action-server:5055/webhook'
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/sanic/app.py", line 942, in handle_request
    response = await response
  File "/app/rasa_sdk/endpoint.py", line 86, in webhook
    result = await executor.run(action_call)
  File "/app/rasa_sdk/executor.py", line 286, in run
    validated_events = self.validate_events(events, action_name)
  File "/app/rasa_sdk/executor.py", line 233, in validate_events
    for e in events:
TypeError: 'coroutine' object is not iterable
Exception occurred while handling uri: 'http://action-server:5055/webhook'
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/sanic/app.py", line 942, in handle_request
    response = await response
  File "/app/rasa_sdk/endpoint.py", line 86, in webhook
    result = await executor.run(action_call)
  File "/app/rasa_sdk/executor.py", line 286, in run
    validated_events = self.validate_events(events, action_name)
  File "/app/rasa_sdk/executor.py", line 233, in validate_events
    for e in events:
TypeError: 'coroutine' object is not iterable
Exception occurred while handling uri: 'http://action-server:5055/webhook'
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/sanic/app.py", line 942, in handle_request
    response = await response
  File "/app/rasa_sdk/endpoint.py", line 86, in webhook
    result = await executor.run(action_call)
  File "/app/rasa_sdk/executor.py", line 286, in run
    validated_events = self.validate_events(events, action_name)
  File "/app/rasa_sdk/executor.py", line 233, in validate_events
    for e in events:
TypeError: 'coroutine' object is not iterable
Exception occurred while handling uri: 'http://action-server:5055/webhook'
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/sanic/app.py", line 942, in handle_request
    response = await response
  File "/app/rasa_sdk/endpoint.py", line 86, in webhook
    result = await executor.run(action_call)
  File "/app/rasa_sdk/executor.py", line 286, in run
    validated_events = self.validate_events(events, action_name)
  File "/app/rasa_sdk/executor.py", line 233, in validate_events
    for e in events:
TypeError: 'coroutine' object is not iterable
Exception occurred while handling uri: 'http://action-server:5055/webhook'
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/sanic/app.py", line 942, in handle_request
    response = await response
  File "/app/rasa_sdk/endpoint.py", line 86, in webhook
    result = await executor.run(action_call)
  File "/app/rasa_sdk/executor.py", line 286, in run
    validated_events = self.validate_events(events, action_name)
  File "/app/rasa_sdk/executor.py", line 233, in validate_events
    for e in events:
TypeError: 'coroutine' object is not iterable

Mhm, something is definitely going wrong here. Can you share the run implementation of your Form? Which rasa-sdk version are you using?

Hi Tobi,

I used the one you shared with me

      def run(self,dispatcher, tracker, domain):
          print("####DEBUGGING####")
          print("Slot: " + str(tracker.slots)) # logging all slots here
          print("####DEBUGGING####")
          return super().run(dispatcher, tracker, domain) # call the function of the superclass to keep the regular form behavior

the rasa sdk version is 1.7.0

I checked here Docker Hub and we are using the latest version.

Ah, my overwrite was wrong :see_no_evil: Can you try this one please?

async def run(self,dispatcher, tracker, domain):
    print("####DEBUGGING####")
    print("Slot: " + str(tracker.slots)) # logging all slots here
    print("####DEBUGGING####")
    return await super().run(dispatcher, tracker, domain) # call the function of the superclass to keep the regular form behavior