RasaHQ / rasa

💬 Open source machine learning framework to automate text- and voice-based conversations: NLU, dialogue management, connect to Slack, Facebook, and more - Create chatbots and voice assistants
https://rasa.com/docs/rasa/
Apache License 2.0
18.7k stars 4.61k forks source link

Rasa x - In talk to your bot, buttons show “New Button” instead of provided text in domain.yml. Also stories flow chat shows "None" instead of intent name. #7534

Closed madhav-nividata closed 3 years ago

madhav-nividata commented 3 years ago

Rasa version: 2.1.3

Rasa SDK version: 2.1.2

Rasa X version: 0.34.0

Python version: 3.7

Operating system (windows, osx, ...): Ubuntu 16.04

Issue: Rasa x - In talk to your bot, buttons show “New Button” instead of provided text in domain.yml. Also stories flow chat shows "None" instead of intent name.

Error (including full traceback):

rasa.core.nlg.interpolator  - Failed to fill utterance template '/chat_bot{"chatbot_type":"artificial_intelligence"}'. Tried to replace '"chatbot_type":"artificial_intelligence"' but could not find a value for it. There is no slot with this name nor did you pass the value explicitly when calling the template. Return template without filling the template. 
Traceback (most recent call last):
  File "/home/nividata/Documents/rasax_new/rasa2.x_version2/venv_rasa_2.1.x/lib/python3.7/site-packages/rasa/core/nlg/interpolator.py", line 28, in interpolate_text
    text = text.format(values)
KeyError: '"chatbot_type":"artificial_intelligence"'
2020-12-13 11:53:33 ERROR    rasa.core.nlg.interpolator  - Failed to fill utterance template '/chat_bot{"chatbot_type":"do_it_yourself"}'. Tried to replace '"chatbot_type":"do_it_yourself"' but could not find a value for it. There is no slot with this name nor did you pass the value explicitly when calling the template. Return template without filling the template. 
Traceback (most recent call last):
  File "/home/nividata/Documents/rasax_new/rasa2.x_version2/venv_rasa_2.1.x/lib/python3.7/site-packages/rasa/core/nlg/interpolator.py", line 28, in interpolate_text
    text = text.format(values)
KeyError: '"chatbot_type":"do_it_yourself"'

Command or request that led to error:

rasa x - In talk to your bot, when I write "Hi" and the response of that is buttons with payload as intent with entity value.

Content of configuration file (config.yml) (if relevant):

language: en

pipeline:
# # See https://rasa.com/docs/rasa/tuning-your-model for more information.
#   - name: WhitespaceTokenizer
   - name: "SpacyNLP"
     model: "en_core_web_md"
     case_sensitive: False
   - name: SpacyTokenizer
   - name: RegexFeaturizer
   - name: SpacyFeaturizer
   - name: LexicalSyntacticFeaturizer
   - name: CountVectorsFeaturizer
   - name: CountVectorsFeaturizer
     analyzer: char_wb
     min_ngram: 1
     max_ngram: 4
     # language model to load
   - name: CRFEntityExtractor
   - name: SpacyEntityExtractor
     # dimensions to extract
     dimensions: ["PERSON"]
   - name: "DucklingEntityExtractor"
     # url of the running duckling server
     url: "http://localhost:8000"
     # dimensions to extract
     dimensions: ["email"]
   - name: DIETClassifier
     epochs: 100
   - name: EntitySynonymMapper
   - name: ResponseSelector
     epochs: 100
     retrieval_intent: chitchat
   - name: FallbackClassifier
     threshold: 0.5
     ambiguity_threshold: 0.1

# Configuration for Rasa Core.
# https://rasa.com/docs/rasa/core/policies/
policies:
# # See https://rasa.com/docs/rasa/policies for more information.
   - name: MemoizationPolicy
   - name: TEDPolicy
     max_history: 5
     epochs: 100
   - name: RulePolicy
     # Confidence threshold for the `core_fallback_action_name` to apply.
     # The action will apply if no other action was predicted with
     # a confidence >= core_fallback_threshold
     core_fallback_threshold: 0.4
     core_fallback_action_name: "action_default_fallback"
     enable_fallback_prediction: True

Content of domain file (domain.yml) (if relevant):

session_config:
  session_expiration_time: 60
  carry_over_slots_to_new_session: true
intents:
- greet
- goodbye
- affirm
- deny
- mood_great
- mood_unhappy
- bot_challenge
- pricing
- chat_bot
- inform_name
- request_demo
- portalchat_details
- portal_chat_services
- inform_email
- stop
entities:
- price
- chatbot_type
- chatbot
- service
- language
- product
- person_name
- email
slots:
  chatbot_type:
    type: categorical
    influence_conversation: false
    values:
    - artificial_intelligence
    - do_it_yourself
responses:
  utter_greet:
  - buttons:
    - payload: /chat_bot{"chatbot_type":"artificial_intelligence"}
      text: AI chat-bot
    - payload: /chat_bot{"chatbot_type":"do_it_yourself"}
      text: DIY your chat-bot
    - payload: /pricing
      text: Pricing
    text: Hey! I am Eva. How can I help you?
  utter_cheer_up:
  - image: https://i.imgur.com/nGF1K8f.jpg
    text: 'Here is something to cheer you up:'
  utter_did_that_help:
  - text: Did that help you?
  utter_happy:
  - text: Great, carry on!
  utter_goodbye:
  - text: Bye
  utter_iamabot:
  - text: I am a bot, powered by Rasa
  utter_pricing:
  - buttons:
    - payload: /contact
      text: Contact Us
    text: There are many different plans catering to customer's requirements
actions:
- action_chat_bot

Content of Story file (stories.yml) (if relevant):

version: "2.0"
stories:
- story: happy path 1
  steps:
  - intent: greet
  - action: utter_greet
- story: happy path 2
  steps:
  - intent: greet
  - action: utter_greet
  - intent: mood_great
  - action: utter_happy
- story: interactive_story_1
  steps:
  - intent: greet
  - action: utter_greet
  - intent: chat_bot
    entities:
    - chatbot_type: do_it_yourself
  - slot_was_set:
    - chatbot_type: do_it_yourself
  - action: action_chat_bot
  - slot_was_set:
    - chatbot_type: do_it_yourself
rules:
  - rule: chat_bot
    steps:
      - intent: chat_bot
      - action: action_chat_bot

Image for "New Button" text instead of button title given image Image for "None" text instead of intent name given image

sara-tagger commented 3 years ago

Thanks for raising this issue, @tttthomasssss will get back to you about it soon✨

Please also check out the docs and the forum in case your issue was raised there too 🤗
madhav-nividata commented 3 years ago

@tttthomasssss @sara-tagger The issue of "New Button" text instead of button text was a mistake in the domain file - its fixed. The key is title and I had entered text. And thus, the button names didn't appear as per the domain file.

However, the issue of stories flow chat shows "None" instead of intent name remains.

mvielkind commented 3 years ago

Hi @madhav-nividata this looks similar to #7194 can workaround this by using double curly braces in your payload defining the intents.

- payload: /chat_bot{{"chatbot_type":"artificial_intelligence"}}