Rasa requests required slot when FormAction is invoked, but custom slot mapping is not called for requested slot

I am using a Rasa form to collect all of the necessary information in order to execute a specific type of query. I define slot mappings for each slot I want to fill in the domain file. E.g

forms:
  object_query_form:
    info_need_obj:
      - type: from_entity
        entity: info_need_obj

I also have a few required slots where none of the predefined slot mappings fit my use case, so I use a custom action to extract and slot those values from the users message. E.g.

class ValidateObjectQueryForm(FormValidationAction): def name(self) → Text: return “validate_object_query_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 + ["identifier", "domain"] 

async def extract_domain(
    self, dispatcher: CollectingDispatcher, tracker: Tracker, domain: Dict
) -> Dict[Text, Any]:
   
    val = code to extract slot
    return {"domain": val}

async def extract_identifier(
    self, dispatcher: CollectingDispatcher, tracker: Tracker, domain: Dict
) -> Dict[Text, Any]:

    val = code to extract slot
    return {"identifier": val}

When the user sends a message to the bot that includes all of the required entities right off the bat, the custom mapping functions are called, no problem. However, when the user does not provide all of the required entities and a slot is requested, say domain, when the user follows up with a domain, the custom mapping function is not called. Instead, Rasa attempts to auto-fill the slot based on the extracted entities (more specifically, using the from_entity mapping).

Why is it that the custom mapping function is not called after a slot is requested?

Just to provide you with some more information, the slots in my domain file are defined like this:

> slots:
>   info_need_obj:
>     type: any
>     influence_conversation: false
>     auto_fill: true
>   domain:
>     type: any
>     influence_conversation: false
>     auto_fill: false
>   identifier:
>     type: any
>     influence_conversation: false
>     auto_fill: false

Also, I am using Rasa version 2.4.0.

Hey @RvERAWRy, I have to say that I’m rather puzzled by this issue and don’t know how it could occur.

Could you try with the latest Rasa OSS version (2.6.3) to check if the problem persists? If it does, please, report this as a bug on GitHub and (in addition to the above info) share also your domain file, the relevant rules, and some stories on which the form succeeds and fails as you’ve described.

I tried with the latest version but the problem persists.

Here is the rule for activating the form (sorry the format is off when I copy/paste)

Object Query

  • rule: Activate ObjectQuery Form steps:

    • intent: object_query
    • action: object_query_form
    • active_loop: object_query_form
  • rule: Submit ObjectQuery Form condition:

    • active_loop: object_query_form steps:
    • action: object_query_form
    • active_loop: null
    • action: action_execute_query

Thanks @RvERAWRy, looks like a bug. Can you report it the way I described above, please?

of course, no problem!

1 Like
1 Like