diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..5b80df3 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,3 @@ +{ + "python.pythonPath": "venv/bin/python" +} \ No newline at end of file diff --git a/actions/__init__.py b/actions/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/actions/actions.py b/actions/actions.py new file mode 100644 index 0000000..8bf1f75 --- /dev/null +++ b/actions/actions.py @@ -0,0 +1,27 @@ +# This files contains your custom actions which can be used to run +# custom Python code. +# +# See this guide on how to implement these action: +# https://rasa.com/docs/rasa/custom-actions + + +# This is a simple example for a custom action which utters "Hello World!" + +# from typing import Any, Text, Dict, List +# +# from rasa_sdk import Action, Tracker +# from rasa_sdk.executor import CollectingDispatcher +# +# +# class ActionHelloWorld(Action): +# +# def name(self) -> Text: +# return "action_hello_world" +# +# def run(self, dispatcher: CollectingDispatcher, +# tracker: Tracker, +# domain: Dict[Text, Any]) -> List[Dict[Text, Any]]: +# +# dispatcher.utter_message(text="Hello World!") +# +# return [] diff --git a/config.yml b/config.yml new file mode 100644 index 0000000..b470b60 --- /dev/null +++ b/config.yml @@ -0,0 +1,22 @@ +language: en +pipeline: + - name: WhitespaceTokenizer + - name: RegexFeaturizer + - name: LexicalSyntacticFeaturizer + - name: CountVectorsFeaturizer + - name: CountVectorsFeaturizer + analyzer: "char_wb" + min_ngram: 1 + max_ngram: 4 + - name: DIETClassifier + epochs: 100 + - name: EntitySynonymMapper + - name: ResponseSelector + epochs: 100 + +policies: + - name: MemoizationPolicy + - name: RulePolicy + - name: TEDPolicy + max_history: 5 + epochs: 100 \ No newline at end of file diff --git a/credentials.yml b/credentials.yml new file mode 100644 index 0000000..f052ef3 --- /dev/null +++ b/credentials.yml @@ -0,0 +1,33 @@ +# This file contains the credentials for the voice & chat platforms +# which your bot is using. +# https://rasa.com/docs/rasa/messaging-and-voice-channels + +rest: +# # you don't need to provide anything here - this channel doesn't +# # require any credentials + + +#facebook: +# verify: "" +# secret: "" +# page-access-token: "" + +#slack: +# slack_token: "" +# slack_channel: "" +# slack_signing_secret: "" + +#socketio: +# user_message_evt: +# bot_message_evt: +# session_persistence: + +#mattermost: +# url: "https:///api/v4" +# token: "" +# webhook_url: "" + +# This entry is needed if you are using Rasa X. The entry represents credentials +# for the Rasa X "channel", i.e. Talk to your bot and Share with guest testers. +rasa: + url: "http://localhost:5002/api" diff --git a/data/nlu.yml b/data/nlu.yml new file mode 100644 index 0000000..787b015 --- /dev/null +++ b/data/nlu.yml @@ -0,0 +1,23 @@ +nlu: +- intent: greet + examples: | + - Hi + - Hey! + - Hello + - Hallo + - Good day + - Good morning + +- intent: signup + examples: | + - I want to get an account + - I want to sign up + - Can you sign me up for an account? + - How do I sign up? + +- intent: inform + examples: | + - My email is example@example.com + - random@example.com + - Please send it to anything@example.com + - Email is something@example.com \ No newline at end of file diff --git a/data/rules.yml b/data/rules.yml new file mode 100644 index 0000000..ec47769 --- /dev/null +++ b/data/rules.yml @@ -0,0 +1,14 @@ +rules: + - rule: activate signup form + steps: + - intent: signup + - action: signup_form + - active_loop: signup_form + + - rule: submit form + condition: + - active_loop: signup_form + steps: + - action: signup_form + - active_loop: null + - action: utter_signedup \ No newline at end of file diff --git a/data/stories.yml b/data/stories.yml new file mode 100644 index 0000000..abf9396 --- /dev/null +++ b/data/stories.yml @@ -0,0 +1,8 @@ +stories: + - story: greet and signup + steps: + - intent: greet + - action: utter_greet + - intent: signup + - action: signup_form + - active_loop: signup_form \ No newline at end of file diff --git a/domain.yml b/domain.yml new file mode 100644 index 0000000..0ee3619 --- /dev/null +++ b/domain.yml @@ -0,0 +1,34 @@ +version: '2.0' +session_config: + session_expiration_time: 60 + carry_over_slots_to_new_session: true +intents: +- greet +- inform +- signup +slots: + email: + type: unfeaturized + influence_conversation: false +responses: + utter_greet: + - text: | + Hello! How can I help you? + - text: | + Hi! + utter_ask_email: + - text: | + What is your email address? + utter_signedup: + - text: | + Check your inbox at {email} in order to finish signing up on Liberta Casa! + - text: You're all set! Check your inbox at {email} to confirm your registration. +actions: +- '...' +- utter_greet +- utter_signedup +forms: + signup_form: + required_slots: + email: + - type: from_text diff --git a/endpoints.yml b/endpoints.yml new file mode 100644 index 0000000..1128e1d --- /dev/null +++ b/endpoints.yml @@ -0,0 +1,42 @@ +# This file contains the different endpoints your bot can use. + +# Server where the models are pulled from. +# https://rasa.com/docs/rasa/model-storage#fetching-models-from-a-server + +#models: +# url: http://my-server.com/models/default_core@latest +# wait_time_between_pulls: 10 # [optional](default: 100) + +# Server which runs your custom actions. +# https://rasa.com/docs/rasa/custom-actions + +#action_endpoint: +# url: "http://localhost:5055/webhook" + +# Tracker store which is used to store the conversations. +# By default the conversations are stored in memory. +# https://rasa.com/docs/rasa/tracker-stores + +#tracker_store: +# type: redis +# url: +# port: +# db: +# password: +# use_ssl: + +#tracker_store: +# type: mongod +# url: +# db: +# username: +# password: + +# Event broker which all conversation events should be streamed to. +# https://rasa.com/docs/rasa/event-brokers + +#event_broker: +# url: localhost +# username: username +# password: password +# queue: queue diff --git a/forms.yml b/forms.yml new file mode 100644 index 0000000..619e020 --- /dev/null +++ b/forms.yml @@ -0,0 +1,5 @@ +forms: + signup_form: + required_slots: + email: + - type: from_text \ No newline at end of file diff --git a/models/20211020-112145.tar.gz b/models/20211020-112145.tar.gz new file mode 100644 index 0000000..3f2c165 Binary files /dev/null and b/models/20211020-112145.tar.gz differ diff --git a/responses.yml b/responses.yml new file mode 100644 index 0000000..eab3f78 --- /dev/null +++ b/responses.yml @@ -0,0 +1,14 @@ +responses: + utter_greet: + - text: | + Hello! How can I help you? + - text: | + Hi! + utter_ask_email: + - text: | + What is your email address? + utter_signedup: + - text: | + Check your inbox at {email} in order to finish signing up on Liberta Casa! + - text: | + You're all set! Check your inbox at {email} to confirm your registration. \ No newline at end of file