2.1.0
Features
-
#329: Extend
FormValidationAction
with support for extracting slots. If you
want to extract an additional slot, add the slot's name to the list ofrequired_slots
and add a methodextract_<slot name>
to your action:from typing import Text, Dict, Any, List, Optional from rasa_sdk.forms import ( FormValidationAction, ) class FormWithSlotExtractions(FormValidationAction): def name(self) -> Text: return "some_form" async def required_slots( self, slots_mapped_in_domain: List[Text], dispatcher: "CollectingDispatcher", tracker: "Tracker", domain: "DomainDict", ) -> Optional[List[Text]]: return slots_mapped_in_domain + ["my_slot"] async def extract_my_slot( self, dispatcher: "CollectingDispatcher", tracker: "Tracker", domain: "DomainDict", ) -> Dict[Text, Any]: return {"my_slot": "some value"}
If all slots returned by
required_slots
are filled,
the action will automatically return an event to disable the form.
If not all required slots are filled, the SDK will return an event
to Rasa Open Source to fill the first missing slot next.
Improvements
- #7078: Adds the method
get_intent_of_latest_message
to theTracker
allowing easier
access to the user's latest intent in case of annlu_fallback
.