-
Notifications
You must be signed in to change notification settings - Fork 4.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0dd893a
commit 20afecc
Showing
14 changed files
with
418 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,40 @@ | ||
version: "3.1" | ||
rules: | ||
- rule: Say goodbye anytime the user says goodbye | ||
steps: | ||
- intent: goodbye | ||
- action: utter_goodbye | ||
|
||
- rule: Say 'I am a bot' anytime the user challenges | ||
steps: | ||
- intent: bot_challenge | ||
- action: utter_iamabot | ||
- rule: greet | ||
steps: | ||
- intent: greet | ||
- action: utter_greet | ||
|
||
- rule: Say goodbye anytime the user says goodbye | ||
steps: | ||
- intent: goodbye | ||
- action: utter_goodbye | ||
|
||
- rule: Say 'I am a bot' anytime the user challenges | ||
steps: | ||
- intent: bot_challenge | ||
- action: utter_iamabot | ||
|
||
- rule: mood_great | ||
steps: | ||
- intent: mood_great | ||
- action: utter_happy | ||
|
||
- rule: mood_unhappy helped | ||
steps: | ||
- intent: mood_unhappy | ||
- action: utter_cheer_up | ||
- action: utter_did_that_help | ||
wait_for_user_input: false | ||
|
||
- rule: mood_unhappy helped | ||
steps: | ||
- action: utter_did_that_help | ||
- intent: affirm | ||
- action: utter_happy | ||
|
||
- rule: mood_unhappy didn't help | ||
steps: | ||
- action: utter_did_that_help | ||
- intent: deny | ||
- action: utter_goodbye |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
test_cases: | ||
- test_case: greet happy | ||
steps: | ||
- user: 'good morning' | ||
- utter: utter_greet | ||
- user: 'great' | ||
- utter: utter_happy | ||
|
||
- test_case: greet,sad,yes | ||
steps: | ||
- user: 'hello there' | ||
- utter: utter_greet | ||
- user: 'sad' | ||
# - action: action_set_slot | ||
- utter: utter_cheer_up | ||
- utter: utter_did_that_help | ||
- user: 'yes' | ||
- utter: utter_happy | ||
|
||
- test_case: greet,sad,no | ||
steps: | ||
- user: 'hey there' | ||
- utter: utter_greet | ||
- user: 'sad' | ||
- utter: utter_cheer_up | ||
- utter: utter_did_that_help | ||
- user: 'no' | ||
- utter: utter_goodbye | ||
|
||
- test_case: greet,happy,yes | ||
steps: | ||
- user: 'hey dude' | ||
- utter: utter_greet | ||
- user: 'amazing' | ||
- utter: utter_happy | ||
|
||
- test_case: goodbye | ||
steps: | ||
- user: bye | ||
- utter: utter_goodbye | ||
|
||
- test_case: bot_challenge | ||
steps: | ||
- user: are you a bot | ||
- utter: utter_iamabot | ||
|
||
- test_case: bot_challenge AI | ||
steps: | ||
- user: are you a AI | ||
- utter: utter_iamabot |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
# Moodbot | ||
|
||
The `moodbot` is a basic Rasa chatbot example. This version uses the Rasa CALM | ||
approach to using LLMs. | ||
|
||
## What’s inside this example? | ||
|
||
This example contains some training data and the main files needed to build an | ||
assistant on your local machine. The `moodbot` consists of the following files: | ||
|
||
- **data/nlu.yml** contains training examples for the NLU model | ||
- **data/flows.yml** contains training flows | ||
- **data/rules.yml** contains training rules for the Core model | ||
- **config.yml** contains the model configuration | ||
- **domain.yml** contains the domain of the assistant | ||
- **credentials.yml** contains credentials for the different channels | ||
|
||
## How to use this example? | ||
|
||
Using this example you can build an actual assistant and chat with it on | ||
different channels. To do so execute the following steps: | ||
|
||
1. Train a Rasa model containing the Rasa NLU and Rasa Core models by running: | ||
``` | ||
rasa train | ||
``` | ||
The model will be stored in the `/models` directory as a zipped file. | ||
|
||
2. If using Rasa Pro, run the e2e tests to confirm the model works as expected: | ||
``` | ||
rasa test e2e | ||
``` | ||
The results should show no errors. | ||
|
||
3. Run a Rasa server that connects, for example, to Facebook: | ||
``` | ||
rasa run -m models -p 5002 --connector facebook --credentials credentials.yml | ||
``` | ||
If you want to connect to a different channel, replace `facebook` with the name of the | ||
desired channel. | ||
All available channels are listed in the `credentials.yml` file. | ||
For more information on the different channels read our | ||
[documentation](http://rasa.com/docs/rasa/messaging-and-voice-channels) | ||
|
||
If you don't want to use any channel, you can chat with your bot | ||
on the command line, using the following command: | ||
``` | ||
rasa shell | ||
``` | ||
|
||
For more information about the individual commands, please check out our | ||
[documentation](http://rasa.com/docs/rasa/command-line-interface). | ||
|
||
## Encountered any issues? | ||
Let us know about it by posting on [Rasa Community Forum](https://forum.rasa.com)! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
recipe: default.v1 | ||
assistant_id: mood_bot | ||
language: en | ||
|
||
pipeline: | ||
- name: LLMCommandGenerator | ||
llm: | ||
model_name: gpt-4 | ||
# model_name: "text-davinci-003" | ||
|
||
policies: | ||
- name: FlowPolicy | ||
- name: RulePolicy |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
twilio: | ||
account_sid: "ACbc2dxxxxxxxxxxxx19d54bdcd6e41186" | ||
auth_token: "e231c197493a7122d475b4xxxxxxxxxx" | ||
twilio_number: "+440123456789" | ||
|
||
slack: | ||
slack_token: "xoxb-xxx" | ||
slack_channel: "#my_channel" # leave out this param to post to DMs with bot app | ||
slack_signing_secret: "123456701ea89032asdebfe5a74518" | ||
|
||
telegram: | ||
access_token: "490161424:AAGlRxinBRtKGb21_rlOEMtDFZMXBl6EC0o" | ||
verify: "your_bot" | ||
webhook_url: "your_url.com/webhook" | ||
|
||
mattermost: | ||
url: "https://chat.example.com/api/v4" | ||
token: "YOUR-TOKEN" | ||
|
||
facebook: | ||
verify: "rasa-bot" | ||
secret: "3e34709d01ea89032asdebfe5a74518" | ||
page-access-token: "EAAbHPa7H9rEBAAuFk4Q3gPKbDedQnx4djJJ1JmQ7CAqO4iJKrQcNT0wtD" | ||
|
||
webexteams: | ||
access_token: "ADD-YOUR-BOT-ACCESS-TOKEN" | ||
room: "YOUR-WEBEXTEAMS-ROOM-ID" | ||
|
||
rocketchat: | ||
user: "your_bot_user" | ||
password: "you_bot_pass" | ||
server_url: "localhost:3000" | ||
ssl: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
flows: | ||
greet: | ||
description: user has started a conversation with a greeting or asking what the bot can do | ||
steps: | ||
- collect: how_are_you | ||
id: "1" | ||
next: | ||
- if: how_are_you == "happy" | ||
then: | ||
- action: utter_happy | ||
next: END | ||
- else: | ||
- action: utter_cheer_up | ||
next: "did_help" # would be nice if this line wasn't required, default go to next step | ||
- collect: did_that_help | ||
id: "2" | ||
next: | ||
- if: did_that_help | ||
then: | ||
action: utter_happy | ||
- else: | ||
action: utter_goodbye |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
version: "3.1" | ||
|
||
nlu: | ||
- intent: affirm | ||
examples: | | ||
- yes | ||
- yup | ||
- intent: deny | ||
examples: | | ||
- no | ||
- nope | ||
- intent: greet | ||
examples: | | ||
- hey | ||
- hello | ||
- hi | ||
- hello there | ||
- good morning | ||
- good evening | ||
- moin | ||
- hey there | ||
- let's go | ||
- hey dude | ||
- goodmorning | ||
- goodevening | ||
- good afternoon | ||
- intent: goodbye | ||
examples: | | ||
- good afternoon | ||
- cu | ||
- good by | ||
- cee you later | ||
- good night | ||
- bye | ||
- goodbye | ||
- have a nice day | ||
- see you around | ||
- bye bye | ||
- see you later | ||
- intent: bot_challenge | ||
examples: | | ||
- are you a bot? | ||
- are you a human? | ||
- am I talking to a bot? | ||
- am I talking to a human? |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
version: "3.1" | ||
rules: | ||
- rule: Say goodbye anytime the user says goodbye | ||
steps: | ||
- intent: goodbye | ||
- action: utter_goodbye | ||
|
||
- rule: Say 'I am a bot' anytime the user challenges | ||
steps: | ||
- intent: bot_challenge | ||
- action: utter_iamabot |
Oops, something went wrong.