Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unfeaturized slots #6817

Merged
merged 26 commits into from
Oct 1, 2020
Merged
Show file tree
Hide file tree
Changes from 23 commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
6154ca2
remove unused `DataSlot`
wochinge Sep 28, 2020
f56112a
add type annotations
wochinge Sep 28, 2020
537187c
add `unfeaturized` flag to slots
wochinge Sep 28, 2020
80655f9
raise if trying to featurize `UnfeaturizedSlot`
wochinge Sep 28, 2020
0ed3445
deprecate `UnfeaturizedSlot`
wochinge Sep 28, 2020
37f6dde
add `AnySlot`
wochinge Sep 28, 2020
9d65bd5
remove `UnfeaturizedSlot` usages
wochinge Sep 28, 2020
4638de0
use `influence_conversation` and remove negation
wochinge Sep 29, 2020
42ff0c6
adapt examples to new `influence_conversation`
wochinge Sep 29, 2020
ed7e505
adapt documentation for slots
wochinge Sep 29, 2020
a65a1b8
add entry for `unfeaturized` slots to migration guide
wochinge Sep 29, 2020
1718f4f
add changelogs
wochinge Sep 29, 2020
b0812d8
update docs which referred to `unfeaturized` slots
wochinge Sep 29, 2020
5f16562
polish ✨
wochinge Sep 29, 2020
fc2599a
persist `influence_conversation`
wochinge Sep 29, 2020
1144b5e
improve phrasing
wochinge Sep 30, 2020
2b76f30
clarify code
wochinge Sep 30, 2020
f0f5733
add hint for subclassing 'Slot' to error message
wochinge Sep 30, 2020
23a98b3
re-arrange slot behavior section
wochinge Sep 30, 2020
f4b6f87
add test for slot persistence
wochinge Sep 30, 2020
d052af8
format slot types in links as code
wochinge Sep 30, 2020
59302b1
clarified arbritrary values
wochinge Sep 30, 2020
4782953
add slot name to deprecation warning
wochinge Sep 30, 2020
c6b26d1
fix deepsource warnings
wochinge Sep 30, 2020
b197158
remove `add_default_values` from parent class
wochinge Oct 1, 2020
a7ae6a8
Merge branch 'master' into unfeaturized-slots
wochinge Oct 1, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions changelog/6809.improvement.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[Slots](domain.mdx#slots) of any type can now be ignored during a conversation.
To do so, specify the property `influence_conversation: false` for the slot.

```yaml
slot:
a_slot:
type: text
influence_conversation: false
```

The property `influence_conversation` is set to `true` by default. See the
[documentation for slots](domain.mdx#slots) for more information.

A new slot type [`any`](domain.mdx#any-slot) was added. Slots of this type can store
any value. Slots of type `any` are always ignored during conversations.
4 changes: 4 additions & 0 deletions changelog/6809.removal.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[Slots](domain.mdx#slots) of type [`unfeaturized`](domain.mdx#unfeaturized-slot) are
now deprecated and will be removed in Rasa Open Source 3.0. Instead you should use
the property `influence_conversation: false` for every slot type as described in the
[migration guide](migration-guide.mdx#unfeaturized-slots).
3 changes: 2 additions & 1 deletion data/test_domains/people_form.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ slots:
person_name:
type: text
requested_slot:
type: unfeaturized
type: text
influence_conversation: false

responses:
utter_ask_person_name:
Expand Down
3 changes: 2 additions & 1 deletion data/test_domains/query_form.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ slots:
query:
type: text
requested_slot:
type: unfeaturized
type: text
influence_conversation: false

responses:
utter_ask_username:
Expand Down
6 changes: 4 additions & 2 deletions data/test_domains/restaurant_form.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,11 @@ slots:
vegetarian:
type: bool
requested_slot:
type: unfeaturized
type: text
influence_conversation: false
search_results:
type: unfeaturized
type: any
influence_conversation: false

responses:
utter_ask_people:
Expand Down
3 changes: 2 additions & 1 deletion data/test_domains/travel_form.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ slots:
GPE_destination:
type: text
requested_slot:
type: unfeaturized
type: text
influence_conversation: false

responses:
utter_ask_GPE_origin:
Expand Down
16 changes: 10 additions & 6 deletions docs/docs/business-logic.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -105,21 +105,25 @@ filled based on the user's intent: If it is `affirm`, it'll be `true`, if it is
`deny`, it'll be `false`.


Since the form relies on certain [slots](domain.mdx#slots) being available, you need to add these slots to the domain. Slots filled by
forms are usually `unfeaturized`, since their value doesn't change
the flow of the conversation.
Since the form relies on certain [slots](domain.mdx#slots) being available, you need
to add these slots to the domain. Slots filled by forms should usually not influence
the conversation. Set `influence_conversation` to `false` to ignore their values during
the conversation:

```yaml-rasa
slots:
cuisine:
type: unfeaturized
type: text
auto_fill: false
influence_conversation: false
num_people:
type: unfeaturized
type: float
auto_fill: false
influence_conversation: false
outdoor_seating:
type: unfeaturized
type: text
auto_fill: false
influence_conversation: false
```

#### Validating Slots
Expand Down
Loading