关于from_entity mapping有以下使用限制:

当一个Rasa form被激活时,只有满足以下条件之一才会使用这种mapping:

1.当form向用户请求了这个slot的信息

2.当form定义的required_slots有这个slot 的特定的mapping信息

之所以存在这种限制是防止使用同样的entity的值来填充多个slots的值。

以下是示例:

slots:

departure_city:

type: text

mappings:

- type: from_entity

entity: city

role: from

- type: from_entity

entity: city

arrival_city:

type: text

mappings:

- type: from_entity

entity: city

role: to

- type: from_entity

entity: city

arrival_date:

type: any

mappings:

- type: from_entity

entity: date

forms:

your_form:

required_slots:

- departure_city

- arrival_city

- arrival_date