Closed koaning closed 2 years ago
Was just going through the docs on unique entity mapping matching - it sounds like similar behavior for other mapping types is desired? I.e. only fill slots based on user utterances inside a form if
a) the slot is requested (so default requested_slot
limitation) AND/OR
b) the slot mapping is unique in the form
IMO though, this adds complexity to the global and explicit conditions
behaviour. If anything, I'd argue for removing unique entity mapping matching
in favor of users having to specify requested_slot
to make that limitation too.
@melindaloubser1 The removal of unique entity mapping matching
in forms might be too last minute before the release, we could follow-up on this after the release. The reason being I don't want to make a hasty removal and replace with conditions
that won't be tested properly before the release planned for next week. Considering this behaviour is only for when requested_slot
is other than the slot with the from_entity
mapping, we'd have to add support for requested_slot
to be processed as a list, when there are multiple other requested_slot
(s).
@koaning Based on the discussion here: https://github.com/RasaHQ/rasa/issues/10219, we will mandate the use of conditions
to maintain 2.x form behaviour in 3.0. The main reason conditions
were added was for this specific use-case in forms and expecting the same 2.x form behaviour without this key in 3.0 is a usage error imo.
Agreed, too short notice now, also not sold on it, but something to consider for after 🙌
Re.
we'd have to add support for requested_slot to be processed as a list, when there are multiple other requested_slot(s).
I don't think this would be needed to remove unique entity mapping (in the future). It would just mean if the user has multiple slots in one form filled by one entity, they would need to constrain those slot mapping with requested_slot
. Each mapping would still only need to give one requested_slot
though - right?
Oh I was talking about the requested_slot
for a unique entity mapping being available as a list (to list all other slots when they are requested to allow this entity mapping to be used), but I think you're referring to restricting a non-unique entity mapping with requested_slot: same_slot
, right? Which is indeed a more efficient solution 😄
Yep exactly!
Follow-up issue created :)
@koaning would it be ok to close this issue since the solution is to use conditions
in the slot mapping?
That's fine, but with a footnote that it would be good to make sure these conditions are explicitly mentioned in the migration guide. They occur to me as a very good/safe practice that many folks will initially be unfamiliar with.
Thanks for the checking 😄 !
@koaning I've added this note in the from_text
section of the docs:
To maintain the 2.x form behavior when using `from_text` slot mappings, you must use [mapping conditions](./domain.mdx#mapping-conditions), where both `active_loop` and `requested_slot` keys are defined.
Plus, developed a bit this paragraph in the migration guide:
For slots that should be filled only in the context of a form, add [mapping conditions](./domain.mdx#mapping-conditions)
to specify which form(s) should be active, as well as indicate if the `requested_slot` should be the same slot.
Adding `conditions` is required to preserve the behavior of slot mappings from 2.0, since without them
the mappings will be applied on each user turn regardless of whether a form is active or not.
Let me know if that's alright!
I am working on a bot in RC2 where I'm supposed to give my name.
Here's a snippet of the domain file where the bot is having well.
This form behaves well, here's a snippet for the behavior in
rasa shell
.So far so good. But let's now remove the conditions.
Here's what
rasa shell
does now.This is a bit strange. The form has two slots but they both automatically get filled from a single utterance. I'd argue that this is a bit greedy, similar to the issue described here. What's going to be confusing to the end-user is that the two responses for asking the user is completely skipped too.
If anybody is interested in reproducing this issue, the project can be found here.