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

Various changes #12408

Closed
wants to merge 574 commits into from
Closed
Show file tree
Hide file tree
Changes from 27 commits
Commits
Show all changes
574 commits
Select commit Hold shift + click to select a range
97e9fa7
improvements
tmbo Aug 22, 2023
8857547
removed context to make space
tmbo Aug 22, 2023
736fb57
WIP - started writing tutorial
amn41 Aug 23, 2023
8178ddf
update tutorial, add to sidebar
amn41 Aug 24, 2023
983314b
removed deliberation
tmbo Aug 24, 2023
52bf8e7
added branch step
tmbo Aug 24, 2023
7e1bca0
Merge branch 'docs-improvements-llms' of github.com:RasaHQ/rasa into …
tmbo Aug 24, 2023
44e94c3
Merge branch 'dm2' into docs-improvements-llms
tmbo Aug 24, 2023
adbe843
implemented question flow step as pattern rather than form
tmbo Aug 28, 2023
a9aa71d
removed unused code
tmbo Aug 28, 2023
5740eec
fixed linting issue
tmbo Aug 28, 2023
08928db
fixed linting issue
tmbo Aug 28, 2023
513cd30
fixed linting issues
tmbo Aug 28, 2023
0ca2bd7
review commetns
tmbo Aug 28, 2023
92285e3
Merge pull request #12749 from RasaHQ/docs-improvements-llms
tmbo Aug 29, 2023
9b1d499
removed unneeded utterance in default project
tmbo Aug 29, 2023
fc00511
code style improvements
tmbo Aug 29, 2023
5d84e69
Merge branch 'main' into dm2
tmbo Aug 30, 2023
c25f53f
Merge branch 'dm2' into questions-as-pattern
tmbo Aug 30, 2023
e62077f
WIP
varunshankar Aug 30, 2023
0aff0c7
fixed format
tmbo Aug 30, 2023
2f79724
improvements
tmbo Aug 31, 2023
1e119ea
improvement
tmbo Aug 31, 2023
9958a39
Merge branch 'main' into dm2
twerkmeister Aug 31, 2023
c9302a9
fixed default pattern
tmbo Aug 31, 2023
13b529f
first stab
tmbo Sep 1, 2023
15c0051
renamed skip_if_filled
tmbo Sep 1, 2023
b963bbb
updated docs
tmbo Sep 1, 2023
13fd4dc
removed outdated comment
tmbo Sep 1, 2023
7ef7be7
Merge pull request #12767 from RasaHQ/questions-as-pattern
tmbo Sep 1, 2023
8aa2ff4
prepared release of version 3.8.0a3
tmbo Sep 1, 2023
db88f97
rename
varunshankar Sep 1, 2023
51c6213
fixed keys in configs. clarified configs
l2nguyen Sep 1, 2023
2c94eae
changed key from model to model_name in llm
l2nguyen Sep 1, 2023
a03a836
Update docs/docs/llms/llm-configuration.mdx
tmbo Sep 1, 2023
1a56391
fix merge conflicts
varunshankar Sep 1, 2023
83a229c
rename
varunshankar Sep 1, 2023
40d219c
some docs improvements
tmbo Sep 1, 2023
5b25e91
rename
varunshankar Sep 1, 2023
4600055
rename png
varunshankar Sep 1, 2023
85f6ccb
Merge pull request #12787 from RasaHQ/azure-config-docs
l2nguyen Sep 1, 2023
88a937d
Apply suggestions from code review
tmbo Sep 1, 2023
efaa956
removed unused clarify next step command
tmbo Sep 1, 2023
7161b3d
rename file
varunshankar Sep 1, 2023
e780fa0
fix lint
varunshankar Sep 1, 2023
1c7f269
fix lint
varunshankar Sep 1, 2023
1be825d
fix chat html
varunshankar Sep 1, 2023
ae17d40
fixed missed rename
tmbo Sep 1, 2023
74fbc7b
Merge branch 'ENG-508-rename-question-attrib' of github.com:RasaHQ/ra…
tmbo Sep 1, 2023
9619c06
fixed renaming issue - missing context
tmbo Sep 1, 2023
5926d6e
fix tests
varunshankar Sep 1, 2023
3556c7a
fix tests
varunshankar Sep 1, 2023
6225266
Merge pull request #12786 from RasaHQ/ENG-508-rename-question-attrib
tmbo Sep 1, 2023
1a8e628
fix merge conflicts
varunshankar Sep 1, 2023
3dcd03c
fixed docsearch version
tmbo Sep 1, 2023
d352e13
Merge branch 'dm2' into ENG-509-rename-dialogue-stack
tmbo Sep 4, 2023
ccd6597
Update docs/docs/llms/flow-policy.mdx
tmbo Sep 4, 2023
5fab102
Merge pull request #12788 from RasaHQ/ENG-509-rename-dialogue-stack
tmbo Sep 4, 2023
cfae3af
improved architecture diagram
tmbo Sep 4, 2023
2d37576
merged dm2
tmbo Sep 4, 2023
3188cbb
remove docs/ changes from dm2 branch
m-vdb Sep 5, 2023
637be3f
compile docs sources raises errors early
m-vdb Sep 5, 2023
ea5d3bc
add missing docs/docs/sources/.keep
m-vdb Sep 5, 2023
de0dbca
Merge pull request #12794 from RasaHQ/cleanup-docs-from-dm2-branch
m-vdb Sep 5, 2023
8f3dd7b
scaffold project for tutorial and --tutorial flag on rasa init
amn41 Sep 5, 2023
5e44456
add missing files
amn41 Sep 5, 2023
a3391d6
improved stack
tmbo Sep 6, 2023
14fe505
moved default flows
tmbo Sep 6, 2023
6971c19
Merge branch 'dm2' into dm2-cleanups
tmbo Sep 6, 2023
a0dcc33
code review comments
tmbo Sep 7, 2023
12a4bd7
prepared release of version 3.8.0a4
tmbo Sep 7, 2023
3e4a2dc
split up commands into modules
tmbo Sep 8, 2023
ba620a1
actions.py file in root of tutorial project
amn41 Sep 8, 2023
5f3cd3c
review comments
tmbo Sep 9, 2023
eb52875
added tests
tmbo Sep 11, 2023
d945172
added comment to filled slots for active flow
tmbo Sep 11, 2023
4eec2e9
fix actions
amn41 Sep 11, 2023
d2abc2f
review improvements
tmbo Sep 11, 2023
61c7423
Merge branch 'dm2' into dm2-cleanups
tmbo Sep 11, 2023
d3da2b8
Merge pull request #12801 from RasaHQ/dm2-cleanups
tmbo Sep 11, 2023
469f1d4
completed tutorial project - some components to be removed
amn41 Sep 11, 2023
e172f2f
tutorial initial project back to minimum
amn41 Sep 11, 2023
b949516
don't warn if there is no nlu data
tmbo Sep 12, 2023
14d1a15
Update rasa/cli/tutorial_project/actions.py
amn41 Sep 12, 2023
7862072
added tests
tmbo Sep 12, 2023
be57455
rm nlu data from tutorial project, requires #12808
amn41 Sep 12, 2023
c8e73fe
Update rasa/model_training.py
tmbo Sep 12, 2023
94a10eb
fixed tests
tmbo Sep 12, 2023
ee3abf5
Merge branch 'no-warnings-if-no-nlu' of github.com:RasaHQ/rasa into n…
tmbo Sep 12, 2023
6639ab7
Merge pull request #12808 from RasaHQ/no-warnings-if-no-nlu
tmbo Sep 12, 2023
db2d7ca
Merge branches 'dm2' and 'add-tutorial-project' of github.com:RasaHQ/…
tmbo Sep 12, 2023
6912724
use template arg
tmbo Sep 12, 2023
1b0cf3d
Merge pull request #12797 from RasaHQ/add-tutorial-project
tmbo Sep 12, 2023
1604472
prepared release of version 3.8.0a5
tmbo Sep 12, 2023
57e6c1f
fixed chat patterns filter
tmbo Sep 12, 2023
88686a5
fixed wrong id
tmbo Sep 13, 2023
fce03b8
Merge pull request #12809 from RasaHQ/dm2-stack-tests
tmbo Sep 13, 2023
dc52887
Merge branch 'dm2' of github.com:RasaHQ/rasa into dm2
tmbo Sep 13, 2023
1574c79
fixed none error
tmbo Sep 13, 2023
1594c05
fixed boolean type coersen
tmbo Sep 13, 2023
435e027
prepared release of version 3.8.0a6
tmbo Sep 13, 2023
1425286
fixedl int
tmbo Sep 13, 2023
03aaf6c
catching any command generator exceptions
twerkmeister Sep 14, 2023
2b48529
added test to make sure abstract method is still honored
twerkmeister Sep 14, 2023
27f0baa
changed license temporarily
tmbo Sep 14, 2023
4eae577
prepared release of version 3.8.0a8
tmbo Sep 15, 2023
ce8922f
prepared release of version 3.8.0a7
tmbo Sep 15, 2023
c0870ae
remoed obsolete type coercion during condition checking of pypred
tmbo Sep 18, 2023
2bfcb05
renamed cdu -> dialogue understanding
tmbo Sep 18, 2023
4a71f91
Merge pull request #12820 from RasaHQ/rename-dm2
tmbo Sep 18, 2023
bf843e3
merged dm2
tmbo Sep 18, 2023
bcc47d3
rename completed
tmbo Sep 18, 2023
87e2858
Merge pull request #12812 from RasaHQ/catch-all-command-generation
tmbo Sep 18, 2023
64beeaf
renamed to collect
tmbo Sep 19, 2023
5c05800
remove rasa chat CLI
m-vdb Sep 20, 2023
c9397f9
logging improvements
tmbo Sep 21, 2023
e3f163b
implemented new flow format
tmbo Sep 21, 2023
2b94111
updated chat to support new format
tmbo Sep 21, 2023
bde8bf1
reset SocketIOInput.session_persistence default
m-vdb Sep 21, 2023
28edf5c
merged main
tmbo Sep 21, 2023
618fc43
Add support for predicate evaluation as a slot validation method (#12…
ancalita Sep 22, 2023
981e6e3
rename custom action in tutorial project
amn41 Sep 22, 2023
cd31c17
rm hardcoded dollar sign
amn41 Sep 22, 2023
856924f
fixed ci issue
tmbo Sep 22, 2023
7702d7a
merged dm2
tmbo Sep 22, 2023
4b3d41b
Merge pull request #12847 from RasaHQ/rename-customaction-tutorial
amn41 Sep 22, 2023
ed71677
Add ability to optionally specify different response for a collect in…
ancalita Sep 22, 2023
02be226
merged dm2
tmbo Sep 22, 2023
c183a92
review comment
tmbo Sep 22, 2023
1112edf
update property name
ancalita Sep 22, 2023
53458a5
more comments
tmbo Sep 22, 2023
ad3712d
Warn if a user has defined a slot named "context" - [ENG 503] (#12829)
varunshankar Sep 24, 2023
f9f54bb
remove rasa chat CLI
m-vdb Sep 25, 2023
4fbb0ea
Merge pull request #12854 from RasaHQ/ATO-1550-rename-scope-property-…
ancalita Sep 25, 2023
a95f26d
moved existing examples into subfolder
amn41 Sep 25, 2023
40b41ee
use (completed) tutorial bot as example - wip
amn41 Sep 25, 2023
b7ad77d
fix some paths
amn41 Sep 25, 2023
708a65c
fix more paths
amn41 Sep 25, 2023
62eb78a
fix path
amn41 Sep 25, 2023
feac44f
split long line
amn41 Sep 25, 2023
22df05b
black
amn41 Sep 25, 2023
a036662
fix link
amn41 Sep 25, 2023
7982311
dm2 merge
tmbo Sep 26, 2023
c98ec11
fixed tests
tmbo Sep 26, 2023
5247210
Merge pull request #12838 from RasaHQ/new-flows-format
tmbo Sep 27, 2023
abb3079
update tutorial project template with new flows fmt
amn41 Sep 27, 2023
2839f88
tutorial template domain file - remove unneeded slot mappings
amn41 Sep 27, 2023
b56a416
Merge branch 'dm2' into move_examples
amn41 Sep 27, 2023
f7ab413
Merge branch 'dm2' into ato-1548-remove-rasa-chat
m-vdb Sep 27, 2023
315153e
example up to date with new flow format
amn41 Sep 27, 2023
9eeeceb
Revert "tutorial template domain file - remove unneeded slot mappings"
amn41 Sep 27, 2023
5d31cfe
Update examples/money_transfer/data/flows.yml
amn41 Sep 28, 2023
966aba4
temp fix ignoring url
amn41 Sep 28, 2023
9a9843f
Merge branch 'move_examples' of github.com:RasaHQ/rasa into move_exam…
amn41 Sep 28, 2023
0179870
Implement `rasa data validate flows` (#12866)
ancalita Sep 29, 2023
6e48abc
Eng 545 stack cleaning (#12834)
twerkmeister Sep 29, 2023
ebc254e
added circuit breaker for flows
tmbo Sep 29, 2023
c0ba3ea
Find all utters used in flows for validation (#12857)
ancalita Oct 2, 2023
c247403
fix CLI tests
m-vdb Oct 3, 2023
b60ecb4
Merge pull request #12836 from RasaHQ/ato-1548-remove-rasa-chat
m-vdb Oct 3, 2023
d1dcf1b
prepared release of version 3.8.0a9
m-vdb Oct 3, 2023
f7921b6
Merge branch 'main' into dm2
m-vdb Oct 4, 2023
f1efbf8
handle error by using an error pattern
tmbo Oct 4, 2023
5359d75
renamed cdu to dialogue_understanding in tests
tmbo Oct 4, 2023
4c6c3f1
prepared release of version 3.8.0a10
sanchariGr Oct 4, 2023
72901ba
review comments
tmbo Oct 4, 2023
9c69718
chore: renamed cdu folder in tests as dialogue_understanding.
djcowley Sep 20, 2023
25ce5fe
added render_template test.
djcowley Sep 20, 2023
4c82cbe
added is extractable tests and tidy up.
djcowley Sep 24, 2023
23329f7
fixed generate commnands tests and tidy up doc strings.
djcowley Sep 26, 2023
97565f8
fixed collect information flow steps and applied black formatter.
djcowley Sep 26, 2023
f4b67fe
fixed missed long line in in tests.
djcowley Sep 26, 2023
6fb3dd8
fixed single trailing whitespace.
djcowley Sep 26, 2023
a088531
fixed use of pipe operator.
djcowley Sep 26, 2023
5cb9634
chore: fix unit tests after rebase.
djcowley Oct 4, 2023
4685233
Install ddtrace seperately on linux and windows
sanchariGr Oct 4, 2023
d2bbb19
merged dm2
tmbo Oct 5, 2023
8194f0b
chore: fix collect_information.
djcowley Oct 5, 2023
56f9a11
Activate venv for windows
sanchariGr Oct 5, 2023
d2f76a9
Merge pull request #12890 from RasaHQ/prepared-release-of-version-3.8…
sanchariGr Oct 5, 2023
78e4702
Merge branch 'dm2' into flow-circuit-breaker
tmbo Oct 5, 2023
f3bd4d8
Free disk space
sanchariGr Oct 5, 2023
801b473
Test docker disk space is freed
sanchariGr Oct 5, 2023
09b533d
Revert CI workflow condition
sanchariGr Oct 5, 2023
9144db8
Merge pull request #12896 from RasaHQ/free-disk-space
sanchariGr Oct 6, 2023
11428f9
Merge pull request #12882 from RasaHQ/flow-circuit-breaker
tmbo Oct 6, 2023
f9f28e5
fixed bug in conditions using the wrong frame
tmbo Oct 7, 2023
ff6de9f
chore: responded to review comments. adding FlowList.user_flows, upda…
djcowley Oct 8, 2023
fc5a2a7
prepared release of version 3.8.0a11
tmbo Oct 9, 2023
5221173
chore: added testing for FlowsList.user_flows including __eq__ method…
djcowley Oct 9, 2023
6b13c0a
chore: addressed comments on tests.
djcowley Oct 10, 2023
1a66128
Add test for NLG change - [ENG 501] (#12875)
varunshankar Oct 10, 2023
503c901
Configure prompts through files - [ENG 510] (#12859)
varunshankar Oct 10, 2023
872757e
Merge branch 'dm2' of github.com:RasaHQ/rasa into dm2
amn41 Oct 11, 2023
c85cf7a
implement changes
ancalita Oct 11, 2023
ff6d3d9
Eng 496 intentless changes (#12900)
twerkmeister Oct 12, 2023
ea8e574
Merge pull request #12913 from RasaHQ/ATO-1625-make-slot-mappings-opt…
ancalita Oct 12, 2023
4b4a29c
Merge branch 'dm2' into ENG-472-Component-Wrap-up-LLMCommandGenerator
djcowley Oct 13, 2023
bae28b8
init flows_yaml_schema
Urkem Sep 26, 2023
1c978eb
add basic schema
Urkem Oct 6, 2023
c38fd21
add fail tests
Urkem Oct 9, 2023
047cd00
add changelog
Urkem Oct 9, 2023
f1ef590
fix minProp
Urkem Oct 9, 2023
d0f32ec
add next to set slot
Urkem Oct 9, 2023
58a1d82
fix set_slots test
Urkem Oct 9, 2023
989dd22
rename set_slot to set_slots
Urkem Oct 9, 2023
759cc94
add intent
Urkem Oct 9, 2023
96254e9
add entry_prompt
Urkem Oct 10, 2023
9ac998b
add null to slot values
Urkem Oct 10, 2023
0ee7aaa
remove docs link
Urkem Oct 10, 2023
286b52d
fix lint
Urkem Oct 10, 2023
345369c
fix read
Urkem Oct 12, 2023
fc61d22
drop reset in set_slots
Urkem Oct 12, 2023
8e9d344
add name to defaults
Urkem Oct 12, 2023
c8871bd
fix test
Urkem Oct 12, 2023
df2b643
add additional slot types
Urkem Oct 12, 2023
0b7311c
fix lint
Urkem Oct 12, 2023
1a32cc3
typo
Urkem Oct 12, 2023
bb2096c
remove just id step
Urkem Oct 13, 2023
41ec137
add next to schemas
Urkem Oct 13, 2023
462fcfe
enforce next to none for link steps
Urkem Oct 13, 2023
ad44021
fix fail messages
Urkem Oct 13, 2023
5198d8b
remove intent step
Urkem Oct 13, 2023
e45d2e9
fix tests
Urkem Oct 13, 2023
463c703
fix lint
Urkem Oct 13, 2023
6eca72a
chore: fixed type hints for python 3.8.
djcowley Oct 16, 2023
7ec98a2
chore: updated schema for flow in test.
djcowley Oct 16, 2023
ca0e002
Disallow dialogue stack slot from being set in custom actions & mark …
ancalita Oct 17, 2023
d1d5c0e
remove comment breaking json
amn41 Oct 17, 2023
3b4dbe9
fix urls
amn41 Oct 17, 2023
7dc7a33
Merge pull request #12860 from RasaHQ/move_examples
m-vdb Oct 18, 2023
09a56a1
chore: updated render prompt test to test line by line.
djcowley Oct 18, 2023
ff28dde
prepared release of version 3.8.0a12 (#12922)
varunshankar Oct 18, 2023
e6e6c3f
chore: corrected test_llm_command_generator.py folder name.
djcowley Oct 18, 2023
d0e3435
Trigger CI
djcowley Oct 18, 2023
69fef21
Merge pull request #12925 from RasaHQ/fix-generator-test-folder-name
djcowley Oct 19, 2023
eccc758
Merge branch 'dm2' of github.com:RasaHQ/rasa into dm2
amn41 Oct 19, 2023
d754306
remove unneeded slot mapping defs
amn41 Oct 19, 2023
0f05c44
add description to amount step
amn41 Oct 19, 2023
2981e0d
Merge branch 'dm2' into ENG-472-Component-Wrap-up-LLMCommandGenerator
djcowley Oct 20, 2023
570c339
Merge pull request #12873 from RasaHQ/ENG-472-Component-Wrap-up-LLMCo…
djcowley Oct 20, 2023
c0a8cf4
Merge pull request #12928 from RasaHQ/tutorial-template-remove-slot-m…
amn41 Oct 20, 2023
9ae3440
Reset slot value for `set_slots` once flow ends (#12918)
ancalita Oct 20, 2023
f71a675
[ENG-594] Remove entry prompt (#12934)
tabergma Oct 23, 2023
22a66ef
wrap up and tests for flow trigger action
tmbo Oct 24, 2023
ed35201
[ENG-597] Increase minimum compatible version (#12929)
tabergma Oct 26, 2023
e0f2cca
[ENG-586] Moved imports of langchain to speed up rasa --help (#12930)
tabergma Oct 26, 2023
012e466
test for regular flow
tmbo Oct 27, 2023
513f42f
Merge pull request #12938 from RasaHQ/ENG-584-wrap-up-flow-trigger-ac…
tmbo Oct 27, 2023
864fe08
Modify LLMCommandGenerator prompt to include possible categorical slo…
varunshankar Oct 27, 2023
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
294 changes: 294 additions & 0 deletions docs/docs/flows.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,294 @@
---
id: flows
sidebar_label: Business Logic with Flows
title: Business Logic with Flows
abstract: |
Flows in Rasa offer a structured way to design conversation-driven business
logic. The documentation details the rules for effectively using and managing
Flows within Rasa.
---

import RasaDiscoveryBanner from "@theme/RasaDiscoveryBanner";

<RasaDiscoveryBanner/>

## Overview

**Flow** is a novel Rasa feature designed to build intuitive,
conversation-centric business logic for your chatbots. Flows are primarily
devised using Studio's Flow builder. However, as a Rasa core feature, they also
offer a YAML counterpart, yielding a specification for creating Flow primitives
in YAML.

In essence, a **Flow** embodies a conversational state machine in the form of a
directed graph. The primary building block of a Flow is a **Step**, equivalent
to a node in the graph. Each step outlines the potential subsequent steps, which
may be associated with certain conditions. Hence, graph vertices are embedded in
steps.

### YAML Specification for Flow

A Flow is defined using the following structure:

```yaml
flows:
a_flow: # an id
name: A flow # a name
description: optional description of a flow
steps: [] # a list of steps
```

## Steps

A `Flow` comprises `step`s. All steps share these common properties:

```yaml
id: a_required_unique_id
description: an optional human readable description of the step
metadata: {} # an optional dict
next: an id or conditionals to determine which step should be executed next
```

Steps can manifest in one of three types: `user_message`, `action`, or
`question`.

### User Message (`user_message`)

This step signifies a user utterance. Here's an example:

```yaml
- id: a_required_unique_id
intent: open_bank_account
entities: [] # optional
description: open a bank account
metadata: {} # an optional dict
next: "5"
```

In this example, the user intent is to open a bank account. The `next` field
indicates the ID of the next step to be taken in the flow, which would be the
step with the ID "5".

A `user_message` step can also support `OR` statements. This means that the flow
can proceed if either of the conditions in the `OR` statement are met:

```yaml
- id: a_required_unique_id
or:
- intent: complaint
entities: [] # optional
- intent: talk_to_agent
entities: [] # optional
description: handle a complaint or talk to an agent
metadata: {} # an optional dict
next: "5"
```

Here, if the user intent is either to make a complaint or to talk to an agent,
the flow would proceed to the step with ID "5".

### Action (`action`)

An `action` step is where the bot performs a specific action or utters a
message. Here are two examples:

```yaml
action: action_xyz
```

This could be a custom action where the bot performs a specific function defined
in your custom actions script.

```yaml
action: utter_xyz
```

This is an utterance action where the bot sends a predefined message to the
user. The message for "utter_xyz" would be defined in the domain file under
responses.

### Question (`question`)

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

```yaml
question: account_type # slot name
```

In this example, the bot is

asking the user to provide their account type. The response will be used to fill
the "account_type" slot.

A question can be configured to be skipped if the slot is already filled, as
shown below:

```yaml
question: first_name # slot name
skip_if_filled: true
```

In this scenario, if the "first_name" slot is already filled, the bot will skip
this question.

The slot can also be configured to be cleared at the end of the flow execution.
The following configuration would clear the slot when a leaf of the flow is
reached OR when exiting a `link`ed node:

```yaml
question: yes_or_no # slot name
scope: flow | global
```

For the `slot_type`, it's recommended to use `text` slots in Flows.

### Scope (`scope`)

Scopes determine the lifespan of a slot or variable. There are two types of
scopes available:

- **flow**: The variable exists only for the duration of the flow. Once the flow
ends, the variable ceases to exist.
- **global**: The variable persists across flows until it is explicitly changed.

### Fill (`fill`)

`Fill` refers to the process of filling slots based on user responses. It is a
simplified version of slot mapping. Below is an example of mapping from
entities:

```yaml
fill:
entity: entity_name
window: question | flow | global
```

Here, the "entity_name" entity from the user's message is extracted and used to
fill a corresponding slot.

Or mapping from intent (or button payload):

```yaml
fill:
intent: affirm
value: "true"
window: question
```

Here, if the user's intent is "affirm", the corresponding slot will be filled
with the value "true".

### Next (`next`)

The `next` field in steps allows for branching logic. For instance:

```yaml
- id: "2"
question: Do you have any other questions?
next:
- intent: affirm
id: "3"
- intent: deny
id: "4"
```

In this example, depending on whether the user's intent is "affirm" or "deny",
the flow will proceed to step "3" or "4", respectively. This allows you to
create complex and dynamic conversational flows that adapt to user inputs.

## Examples

### Hello World Flow

```yaml
flows:
hello_world:
name: Hello World!
description: A basic flow
steps:
- id: "1"
intent: greet
next: "2"
- id: "2"
action: utter_greet
```

The intent `greet` and the response template `utter_greet` need to be defined in
the domain file.

The `next` property determines the id of the next step and links all the
different steps together.

### A basic flow with branching

```yaml
flows:
basic_flow_with_branching:
name: basic flow with branching
description: a flow with a branch
steps:
- id: "1"
intent: greet
next: "2"
- id: "2"
action: utter_greet
next: "3"
- id: "3"
question: age
next:
- if: age < 18
then: "4"
- else: "5"
- id: "4"
action: utter_too_young
- id: "5"
action: utter_old_enough
```

### Asking for confirmation
- TODO: include flow but also slot configuration from domain
- TODO: include branching on the result of the user selection

### Multiple Flows with links

```yaml
flows:
flow_with_links:
name: flow with links
description: optional description of a flow with links
steps:
- id: "1"
intent: greet
next: "2"
- id: "2"
action: utter_greet
next: "3"
- id: "3"
link: collect_personal_details
next:
- if: age < 18
then: "4"
- else: "5"
- id: "4"
action: utter_too_young
next: "6"
- id: "5"
action: utter_old_enough
next: "6"
- id: "6"
link: another_flow

collect_personal_details:
name: collect details
description: gather personal details from the user
steps:
- id: "1"
question: first_name
next: "2"
- id: "2"
question: last_name
next: "3"
- id: "3"
question: age
```
11 changes: 11 additions & 0 deletions docs/docs/llms/flow-policy.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
id: flow-policy
sidebar_label: Flow Policy
title: Flow Policy
abstract: |
Running Flows with the FlowPolicy.
---

import RasaDiscoveryBanner from "@theme/RasaDiscoveryBanner";

<RasaDiscoveryBanner/>
Binary file added docs/docs/llms/intentless-policy-interaction.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
70 changes: 70 additions & 0 deletions docs/docs/llms/large-language-models.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
---
id: large-language-models
sidebar_label: LLMs in Rasa
title: Using LLMs with Rasa
className: hide
abstract:
---

import llmUsageArchitecture from "./llm-usage-architecture.png";
import RasaLabsLabel from "@theme/RasaLabsLabel";
import RasaLabsBanner from "@theme/RasaLabsBanner";

<RasaLabsLabel />

<RasaLabsBanner />

Large Language Models (LLMs), pretrained models using retrieval-augmented
generation, can be utilized with Rasa in several ways. This document offers an
overview of those usage patterns and how to handle them.

## A future-proof approach using generative models

The recent advances in large language models (LLMs) have opened up new
possibilities for conversational AI. LLMs are pretrained models that can be
fine-tuned to perform a variety of tasks, including intent classification,
dialogue handling, and natural language generation (NLG).

### An adjustable risk profile

The potential and risks of LLMs vary per use case, with more tolerance for error
internally than for customer-facing applications. As your organization becomes
more familiar with the technology, you may be more open to its uses, such as
enhancing the NLU pipeline, managing long-tail topics, or subtly altering bot
responses in low-risk situations.

It's essential that your system provides full
control over these processes. Understanding how LLMs and other components
behave and have the power to override any decision.

### Orchestration at the center

A robust future-proof architecture leverages multiple LLMs for multiple
jobs. And it puts the orchestration of components at the center, with the LLMs
as exchangeable utilities / components in various places.

<Image
img={llmUsageArchitecture}
caption="LLM Component usage in Rasa"
alt=""
/>

LLMs are a key component of a future-proof architecture. More importantly,
we have the flexibility to use different LLMs for different purposes
and can plug the models of our choice as the technology evolves.

## Where to go from here

This section of the documentation guides you through the diverse ways you can
integrate LLMs into Rasa. We will delve into the following topics:

1. [Setting up LLMs](./llm-setup.mdx)
2. [Intent Classification with LLMs](./llm-intent.mdx)
3. [Dialogue Handling using LLMs](./llm-intentless.mdx)
4. [NLG using LLMs](./llm-nlg.mdx)
5. [Custom usage of LLMs](./llm-custom.mdx)

Each link will direct you to a detailed guide on the respective topic, offering
further depth and information about using LLMs with Rasa. By the end of this
series, you'll be equipped to effectively use LLMs to augment your Rasa
applications.
13 changes: 13 additions & 0 deletions docs/docs/llms/llm-custom.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
id: llm-custom
sidebar_label: Customizing LLM Components
title: Customizing LLM based Components
abstract:
---

import RasaLabsLabel from "@theme/RasaLabsLabel";
import RasaLabsBanner from "@theme/RasaLabsBanner";

<RasaLabsLabel />

<RasaLabsBanner />
Loading