Hi, i am using form action to achieve the use case.
for dynamic slot mapping:
depending on my doc_type entity value I am requesting for dynamic slot standard_doc_type that needs to be updated by an entity named “mention” or from latest text.
required_slots = slots_mapped_in_domain
if tracker.slots.get("doc_type") in ["STANDARD"]:
required_slots = ["standard_doc_type"]+ slots_mapped_in_domain
However i get Failed to extract requested slot ‘standard_doc_type’ precisely because the default mapping if no mapping provided in domain is by the entity of same name. However my requirement is entirely different. Is there a way to provide different mapping for Dynamic slots?
As per documentation:
async def extract_standard_doc_type(
self, dispatcher: CollectingDispatcher, tracker: Tracker, domain: Dict
) -> Dict[Text, Any]:
application = next(tracker.get_latest_entity_values("application"), None)
user_text = tracker.latest_message.get("text")
LOG.info(f"value of user action extracted : {user_text}")
LOG.info(f"latest application entity extracted : {application}")
if not application and application == "Application_name":
return {"standard_doc_type": application}
else:
user_text = tracker.latest_message.get("text")
LOG.info(f"value of user action extracted : {user_text}")
return {"standard_doc_type": user_text}
forms: document_form:
doc_type:
- type: from_entity
entity: doc_type
- type: from_entity
entity: mention
intent: inform
2021-08-11 21:57:43 DEBUG rasa.core.actions.forms - Trying to extract requested slot 'standard_doc_type' ...
2021-08-11 21:57:43 DEBUG rasa.core.actions.forms - Got mapping '{'type': 'from_entity', 'entity': 'standard_doc_type', 'intent': [], 'not_intent': [], 'role': None, 'group': None}'
2021-08-11 21:57:43 DEBUG rasa.core.actions.forms - Failed to extract requested slot 'standard_doc_type'