Skip to content

Commit

Permalink
rename
Browse files Browse the repository at this point in the history
  • Loading branch information
varunshankar committed Sep 1, 2023
1 parent e62077f commit db88f97
Show file tree
Hide file tree
Showing 11 changed files with 126 additions and 119 deletions.
42 changes: 21 additions & 21 deletions docs/docs/flows.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -93,15 +93,15 @@ To link to the next step, you can use the `id` of the next step:

```yaml
- id: "some_question"
question: "age"
collect_information: "age"
next: "id_of_the_next_step"
```

To create branching logic, you can use conditionals:

```yaml
- id: "some_question"
question: "age"
collect_information: "age"
next:
- if: age < 18
then: "under_18_step"
Expand All @@ -128,7 +128,7 @@ Steps can manifest in one of the following types:
- [generation prompt step](./flows.mdx#generation-prompt): a prompt to generate
a message that will be sent to the user
- [set slots step](./flows.mdx#set-slots): a step to set slots
- [question step](./flows.mdx#question): a question to be asked to the user
- [collect_information step](./flows.mdx#question): a question to be asked to the user
- [link step](./flows.mdx#link): a step to link to another flow

### Branching Conditions
Expand Down Expand Up @@ -159,7 +159,7 @@ Use parentheses to group expressions and control the order of evaluation. For ex

```yaml
- id: "some_question"
question: "age"
collect_information: "age"
next:
- if: age < 18
then: "under_18_step"
Expand All @@ -173,7 +173,7 @@ Sets can be used to check for multiple conditions. For example:

```yaml
- id: "1"
question: "emergency"
collect_information: "emergency"
next:
- if: {"WARN" "ERR" "CRIT"} contains error_level
then: "handoff"
Expand All @@ -194,7 +194,7 @@ the `zipcode` slot contains a United States zip code :

```yaml
- id: "ask_zipcode"
question: "zipcode"
collect_information: "zipcode"
description: "ask zipcode and check if its a zip code"
next:
- if: zipcode matches "\d{5}(-\d{4})?"
Expand Down Expand Up @@ -422,14 +422,14 @@ In this example, the slot with the key `account_type` is set to the value
- account_number: "123456789"
```

### Question
### Collect Information

In a `question` step, the bot asks a question, with the aim usually being to
In a `collect_information` step, the bot asks a question, with the aim usually being to
fill a slot. Here is an example:

```yaml
- id: "a_question_step"
question: "account_type" # slot name
collect_information: "account_type" # slot name
```

In this example, the bot is asking the user to provide their account type. The
Expand All @@ -453,7 +453,7 @@ can set `skip_if_filled: false` on the question:

```yaml
- id: "confirm_dangerous_step"
question: "final_confirmation" # slot name
collect_information: "final_confirmation" # slot name
skip_if_filled: false
```

Expand Down Expand Up @@ -531,7 +531,7 @@ flows:
action: "utter_greet"
next: "3"
- id: "3"
question: "age"
collect_information: "age"
next:
- if: age < 18
then: "4"
Expand All @@ -555,7 +555,7 @@ flows:
intent: "transfer_money"
next: "1"
- id: "1"
question: "money"
collect_information: "money"
next: "2"
- id: "2"
question: "confirm_transfer"
Expand Down Expand Up @@ -597,7 +597,7 @@ responses:
```

The snippet shows the responses and slot configuration that is needed to make
the `question` steps in the `tranfer_money` flow work.
the `collect_information` steps in the `tranfer_money` flow work.

#### Flows branching on the result of the user selection

Expand All @@ -613,27 +613,27 @@ flows:
action: "utter_greet"
next: "3"
- id: "3"
question: "account_type"
collect_information: "account_type"
next:
- if: account_type == "checking"
then: "5"
- if: account_type == "savings"
then: "7"
- else: "9"
- id: "5"
question: "specific_checking_question"
collect_information: "specific_checking_question"
next: "6"
- id: "6"
action: "utter_something_specific_to_checking"
next: "11"
- id: "7"
question: "specific_savings_question"
collect_information: "specific_savings_question"
next: "8"
- id: "8"
action: "utter_something_specific_to_savings"
next: "11"
- id: "9"
question: "specific_credit_card_question"
collect_information: "specific_credit_card_question"
next: "10"
- id: "10"
action: "utter_something_specific_to_credit_card"
Expand All @@ -644,7 +644,7 @@ flows:

This example flow demonstrates how to implement branching flows based on
multiple conditions. It involves fetching the slot `account_type` using a
`question` step, and the value of this slot is then used to determine which
`collect_information` step, and the value of this slot is then used to determine which
specific flow should be executed.

### Multiple Flows with links
Expand Down Expand Up @@ -681,13 +681,13 @@ flows:
description: "gather personal details from the user"
steps:
- id: "1"
question: "first_name"
collect_information: "first_name"
next: "2"
- id: "2"
question: "last_name"
collect_information: "last_name"
next: "3"
- id: "3"
question: "age"
collect_information: "age"
```

This example demonstrates how the `link` step in flows enables the invocation of
Expand Down
4 changes: 2 additions & 2 deletions docs/docs/llms/flow-policy.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,10 @@ flows:

steps:
- id: "ask_recipient"
question: transfer_money_recipient
collect_information: transfer_money_recipient
next: "ask_amount"
- id: "ask_amount"
question: transfer_money_amount_of_money
collect_information: transfer_money_amount_of_money
next: "check_transfer_funds"
# - ...
```
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/llms/unhappy-paths.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ flows:

steps:
- id: "0"
question: confirm_correction
collect_information: confirm_correction
next:
- if: confirm_correction
then: "1"
Expand Down
8 changes: 4 additions & 4 deletions docs/docs/start-here.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -127,21 +127,21 @@ Given the range of conversations this assistant can handle, you might expect the
In fact, there are only two small files that provide Rasa what it needs.

The `data/flows/restaurants.yml` file defines the logic for this flow. In this example the logic is linear
and walks the user through each of the steps in order. Each of the `question` steps fills the corresponding slot.
and walks the user through each of the steps in order. Each of the `collect_information` steps fills the corresponding slot.

```yaml
flows:
recommend_restaurant:
description: This flow recommends a restaurant
steps:
- id: "0"
question: cuisine
collect_information: cuisine
next: "1"
- id: "1"
question: price_range
collect_information: price_range
next: "2"
- id: "2"
question: part_of_town
collect_information: part_of_town
next: "3"
- id: "3"
action: search_restaurants
Expand Down
24 changes: 12 additions & 12 deletions docs/docs/tutorial.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -91,10 +91,10 @@ flows:
description: This flow lets users send money to friends and family.
steps:
- id: "ask_recipient"
question: recipient
collect_information: recipient
next: "ask_amount"
- id: "ask_amount"
question: amount_of_money
collect_information: amount_of_money
next: "utter_transfer_complete"
- id: "transfer_successful"
action: utter_transfer_complete
Expand All @@ -109,11 +109,11 @@ The `steps` describe the business logic required to do what the user asked for.

There are three steps defined, each with an `id`.
The `id` can be anything you like, but it's a good idea to use names that make it clear what is going on.
The first step is a `question` step, which is used to fill a `slot`.
The first step is a `collect_information` step, which is used to fill a `slot`.
`Slots` are a key-value memory store used during a conversation.
A `question` step sends a message to the user requesting information, and waits for an answer.
A `collect_information` step sends a message to the user requesting information, and waits for an answer.

The syntax `question: transfer_money_recipient` means that when the user answers, Rasa will try to use
The syntax `collect_information: transfer_money_recipient` means that when the user answers, Rasa will try to use
their answer to fill the slot `recipient`.
It also means that Rasa will look for a `response` called `utter_ask_recipient`.

Expand Down Expand Up @@ -173,7 +173,7 @@ responses:

Notice that your confirmation question uses curly brackets `{}` to include slot values in your response.

Add a `question` step to your flow, and change the `next` attribute of the `ask_amount` step to
Add a `collect_information` step to your flow, and change the `next` attribute of the `ask_amount` step to
match the `id` of your newly created step.

```yaml
Expand All @@ -182,14 +182,14 @@ flows:
description: This flow lets users send money to friends and family.
steps:
- id: "ask_recipient"
question: recipient
collect_information: recipient
next: "ask_amount"
- id: "ask_amount"
question: amount_of_money
collect_information: amount_of_money
// highlight-start
next: "confirm_transfer"
- id: "confirm_transfer"
question: final_confirmation
collect_information: final_confirmation
next:
- if: final_confirmation
then: "transfer_successful"
Expand Down Expand Up @@ -293,10 +293,10 @@ flows:
description: This flow lets users send money to friends and family.
steps:
- id: "ask_recipient"
question: recipient
collect_information: recipient
next: "ask_amount"
- id: "ask_amount"
question: amount_of_money
collect_information: amount_of_money
// highlight-start
next: "check_balance"
- id: "check_balance"
Expand All @@ -309,7 +309,7 @@ flows:
action: utter_transfer_money_insufficient_funds
// highlight-end
- id: "confirm_transfer"
question: final_confirmation
collect_information: final_confirmation
next:
- if: final_confirmation
then: "transfer_successful"
Expand Down
2 changes: 1 addition & 1 deletion rasa/cdu/command_generator/command_prompt_template.jinja2
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Here is what happened previously in the conversation:
===
{% if current_flow != None %}
You are currently in the flow "{{ current_flow }}", which {{ current_flow.description }}
You have just asked the user for the slot "{{ question }}"{% if question_description %} ({{ question_description }}){% endif %}.
You have just asked the user for the slot "{{ collect_information }}"{% if collect_information_description %} ({{ collect_information_description }}){% endif %}.

{% if flow_slots|length > 0 %}
Here are the slots of the currently active flow:
Expand Down

0 comments on commit db88f97

Please sign in to comment.