Rasa 2.0.2版本表单无法激活加载的技术求助
Hey there, let's figure out why your informative_form isn't loading in Rasa 2.0.2, especially since you confirmed it works smoothly in 2.7.0. After reviewing your configuration files, I've spotted several key issues that are likely causing the problem—let's break them down and fix them step by step.
Key Issues Identified
1. Duplicate Form Definition
You’ve defined informative_form in both domain.yml and forms.yml. Rasa 2.0.2 doesn’t support standalone forms.yml files yet (this feature was introduced in later 2.x versions). Having duplicate definitions creates conflicts that prevent the form from being recognized.
2. Mismatched Utterance and Slot Names
Rasa 2.0.x requires strict naming alignment between slot prompts and slot names. Your slots are named like slot_date, but your corresponding utterances are utter_ask_date—the utterance name should follow the pattern utter_ask_[slot_name] (e.g., utter_ask_slot_date for the slot_date slot). This mismatch means Rasa can’t link the prompt to the correct slot, so the form can’t progress.
3. Missing Form Action in Actions List
The form’s auto-generated action (action_informative_form) isn’t listed in your domain.yml’s actions section. Rasa needs this entry to recognize and execute the form logic.
4. No Form Activation Trigger
There’s no rule or story to tell Rasa when to activate the informative_form. In 2.0.2, forms won’t activate automatically—you need explicit triggers to start the form loop.
Step-by-Step Fixes
1. Remove Duplicate Form Configuration
Delete the entire forms.yml file. Keep all form definitions exclusively in domain.yml to avoid conflicts.
2. Align Utterance and Slot Names
Update your responses and actions to match the slot naming convention:
- Rename
utter_ask_date→utter_ask_slot_date - Rename
utter_ask_time→utter_ask_slot_time - Rename
utter_ask_firstname→utter_ask_slot_firstname - Rename
utter_ask_lastname→utter_ask_slot_lastname - Rename
utter_ask_email→utter_ask_slot_email - Rename
utter_ask_country→utter_ask_slot_country
Update these entries in both the responses and actions sections of domain.yml.
3. Add the Form Action to Domain.yml
Add action_informative_form to your actions list in domain.yml:
actions: - '...' - utter_greet - utter_kuh # ... keep all existing utterances ... - action_informative_form # Add this line
4. Add a Form Activation Rule
Create a rules.yml file (or add to your existing stories) to trigger the form when the user requests a demo:
version: "2.0" rules: - rule: Activate demo booking form steps: - intent: book demo - action: informative_form - active_loop: informative_form
5. (Optional) Improve Slot Mappings
For better slot extraction accuracy, update your slot mappings to use intent-specific extraction where possible. For example, for slot_date:
slot_date: - type: from_intent intent: date entity: date # Ensure you've defined a 'date' entity in nlu.yml if using this - type: from_text # Fallback if intent/entity isn't recognized
Final Checks
After making these changes:
- Train your model with
rasa train - Test the flow with
rasa shellto confirm the form activates and prompts for each slot correctly
内容的提问来源于stack exchange,提问作者Kareem Al Aridi

