Global Slot Mappings: Dynamic slots not considered in `_get_slot_extractions`
See original GitHub issueRasa Open Source version
3.0.0rc1
Rasa SDK version
3.0.0rc1
Rasa X version
No response
Python version
3.9
What operating system are you using?
OSX
What happened?
When I try to fill a dynamically requested slot a ActionExecutionRejection
is raised.
To reproduce:
- Specify a form and a required slot
- Add a
validate_<form_name>
action to your domain - Override
required_slots
in yourFormValidationAction
so that it requests aslot2
ifslot1
as a certain value - When Rasa Open Source asks you to fill slot2 → fill it
- Expected: Form is submitted since all values are filled
Actual: The form rejects it’s execution as
_get_slot_extractions
returns an empty list. As this means we have aslot_to_validate
andsome_slots_were_validated==False
the form rejects its execution
version: "2.0"
intents:
- greet
- goodbye
- affirm
- deny
- mood_great
- mood_unhappy
- bot_challenge
- start_form
actions:
- validate_tobi_form
entities:
- entity1
- entity2
- entity3
- entity4
- entity5
- entity6
slots:
slot1:
type: any
influence_conversation: false
mappings:
- type: from_entity
entity: entity1
conditions:
- active_loop: tobi_form
requested_slot: slot1
slot2:
type: any
influence_conversation: false
mappings:
- type: from_entity
entity: entity1
conditions:
- active_loop: tobi_form
requested_slot: slot2
responses:
utter_greet:
- text: "Hey! How are you?"
utter_cheer_up:
- text: "Here is something to cheer you up:"
image: "https://i.imgur.com/nGF1K8f.jpg"
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_ask_slot1:
- text: "Slot 1 please"
utter_ask_slot2:
- text: "Slot 2 please"
utter_ask_slot3:
- text: "Slot 3 please"
utter_ask_slot4:
- text: "Slot 4 please"
utter_ask_slot5:
- text: "Slot 5 please"
utter_ask_slot6:
- text: "Slot 6 please"
utter_submit:
- text: "Submitted"
session_config:
session_expiration_time: 60
carry_over_slots_to_new_session: true
forms:
tobi_form:
required_slots:
- slot1
from typing import Dict, Text, Any, List
from rasa_sdk import Tracker
from rasa_sdk.executor import CollectingDispatcher
from rasa_sdk.forms import FormValidationAction
class TobiFormValidation(FormValidationAction):
def name(self) -> Text:
return "validate_tobi_form"
async def required_slots(
self,
domain_slots: List[Text],
dispatcher: "CollectingDispatcher",
tracker: "Tracker",
domain: "DomainDict",
) -> List[Text]:
"""Returns slots which the validation action should fill.
Args:
domain_slots: Names of slots of this form which were mapped in
the domain.
dispatcher: the dispatcher which is used to
send messages back to the user.
tracker: the conversation tracker for the current user.
domain: the bot's domain.
Returns:
A list of slot names.
"""
if tracker.slots["slot1"] == "beer":
return domain_slots + ["slot2"]
return domain_slots
Command / Request
No response
Relevant log output
No response
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (5 by maintainers)
Top Results From Across the Web
Allow slots added dynamically to a form via ... - GitHub
Problem description: A slot with a global slot mapping that is added dynamically to a form can be set by ActionExtractSlots in rasa...
Read more >change default mapping for dynamic form - Rasa Open Source
Hi, i am using form action to achieve the use case. for dynamic slot mapping: depending on my doc_type entity value I am...
Read more >Slots - Vue.js
Slot content is not just limited to text. It can be any valid template content. For example, we can pass in multiple elements,...
Read more >Slot mapping | Amplience Developer Portal
The Dynamic Content integration supports two types of SFCC content slots: global slots and category slots. A Dynamic Content slot is mapped to...
Read more >Use named slots inside grand-child component - Stack Overflow
You may need to set this up for each slot. If you want to pass all of them along dynamically(without knowing their names),...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@wochinge Ok, after removing the cache, I ran
rasa train
and thenrasa shell --debug
and the slots were filled, but the form was not deactivated but rejected, as you said, and a different bot response was predicted rather thanutter_submit
. No exception was raised this time.@ancalita I think the exception is related to something @joejuzl has discovered and is working on. Can you please try to delete the cache with
rm -r .rasa
and then retry validating this?