Commit c5b32e3b authored by H.S.D.N Gunasekara's avatar H.S.D.N Gunasekara

Deleted ChatBot/actions/actions.py, ChatBot/data/nlu.yml,...

Deleted ChatBot/actions/actions.py, ChatBot/data/nlu.yml, ChatBot/data/rules.yml, ChatBot/data/stories.yml, ChatBot/config.yml, ChatBot/credentials.yml, ChatBot/domain.yml, ChatBot/endpoints.yml files
parent 70703bf0
# 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 ActionFindCloth(Action):
def name(self) -> Text:
return "action_find_cloth"
def run(self, dispatcher: CollectingDispatcher,
tracker: Tracker,
domain: Dict[Text, Any]) -> List[Dict[Text, Any]]:
for blob in tracker.latest_message['entities']:
print(tracker.latest_message)
if blob['entity'] == 'pattern':
name = blob['value']
if name == 'Animal print':
dispatcher.utter_message(text=f"Yes, {name} is a pokemon.")
else:
dispatcher.utter_message(
text=f"I do not recognize {name}, are you sure it is correctly spelled?")
return []
\ No newline at end of file
# Configuration for Rasa NLU.
# https://rasa.com/docs/rasa/nlu/components/
language: en
pipeline:
# # No configuration for the NLU pipeline was provided. The following default pipeline was used to train your model.
# # If you'd like to customize it, uncomment and adjust the pipeline.
# # See https://rasa.com/docs/rasa/tuning-your-model for more information.
# - name: WhitespaceTokenizer
# - name: RegexFeaturizer
# - name: LexicalSyntacticFeaturizer
# - name: CountVectorsFeaturizer
# - name: CountVectorsFeaturizer
# analyzer: char_wb
# min_ngram: 1
# max_ngram: 4
# - name: DIETClassifier
# epochs: 100
# constrain_similarities: true
# - name: EntitySynonymMapper
# - name: ResponseSelector
# epochs: 100
# constrain_similarities: true
# - name: FallbackClassifier
# threshold: 0.3
# ambiguity_threshold: 0.1
# Configuration for Rasa Core.
# https://rasa.com/docs/rasa/core/policies/
policies:
# # No configuration for policies was provided. The following default policies were used to train your model.
# # If you'd like to customize them, uncomment and adjust the policies.
# # See https://rasa.com/docs/rasa/policies for more information.
# - name: MemoizationPolicy
# - name: RulePolicy
# - name: TEDPolicy
# max_history: 5
# epochs: 100
# constrain_similarities: true
# - name: RulePolicy
# - name: TEDPolicy
# max_history: 5
# epochs: 100
# constrain_similarities: true
# 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
telegram:
access_token: "1893025239:AAG1LjYj8Fag34sdR_3qpHTjvSTa4I6tVsk"
verify: "My_Duli_bot"
webhook_url: "https://f9e4661ebb6b.ngrok.io/webhooks/telegram/webhook"
#facebook:
#verify: "<verify>"
#secret: "<your secret>"
#page-access-token: "<your page access token>"
#slack:
# slack_token: "<your slack token>"
# slack_channel: "<the slack channel>"
# slack_signing_secret: "<your slack signing secret>"
#socketio:
# user_message_evt: <event name for user message>
# bot_message_evt: <event name for bot messages>
# session_persistence: <true/false>
#mattermost:
# url: "https://<mattermost instance>/api/v4"
# token: "<bot token>"
# webhook_url: "<callback 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"
version: "2.0"
nlu:
- 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: affirm
examples: |
- yes
- y
- Yes 🙂
- indeed
- of course
- that sounds good
- correct
- okay
- Yes, great!
- intent: deny
examples: |
- no
- n
- never
- I don't think so
- don't like that
- no way
- not really
- No, not much
- No 🙁
- intent: mood_great
examples: |
- perfect
- great
- amazing
- feeling like a king
- wonderful
- I am feeling very good
- I am great
- I am amazing
- I am going to save the world
- super stoked
- extremely good
- so so perfect
- so good
- so perfect
- intent: welcome_message
examples: |
- welcome
- welcome message
- I don't feel very well
- I am disappointed
- super sad
- I'm so sad
- sad
- very sad
- unhappy
- not good
- not very good
- extremly sad
- so saad
- so sad
- intent: bot_challenge
examples: |
- are you a bot?
- are you a human?
- am I talking to a bot?
- am I talking to a human?
- intent: need_help
examples: |
- I need help
- yes I need help
- I want help
- Yes please help me
- intent: not_needed_help
examples: |
- I do not need help
- I do not want help
- No I don`t want help
- No I don`t need help
- intent: satisfied
examples: |
- Yes
- Yes they are good
- perfect
- sounds good
- sounds greate
- intent: not_satisfied
examples: |
- no
- No, I couldn`t find the item which I was looking for
- It`s not match for me
- I don`t like them
- They weren`t good
- boring
- intent: colors
examples: |
- Red
- Pink
- Orange
- Yellow
- Purple
- Green
- Blue
- Brown
- Violet
- Olive
- Navy
- intent: female_cloth
examples: |
- Dress
- Blouse
- Shirt
- T-shirt
- Coat
- Skirt
- Pant
- Jean
- Short
- Legging
- intent: female_dress
examples: |
- Dress
- Frock
- dress
- intent: female_blouse
examples: |
- blouse
- Blouse
- intent: sleeves_length_dress
examples: |
- Short Sleeve(halfway between shoulder & elbow)
- between shoulder & elbow
- intent: sleeves_type_dress
examples: |
- Short
- short
- intent: collar_type_dress
examples: |
- collar less
- no collars
- intent: collar_type_blouse
examples: |
- with collars
- intent: pattern_dress
examples: |
- polka
- dot
- intent: color_dress
examples: |
- blue
- navy blue
- dark blue
- sky blue
- intent: color_blouse
examples: |
- red
- orange
- dark red
# - intent: male_cloth
# examples: |
# - Shirt
# - T-shirt
# - Pant
# - Short
# - intent: sleeves_length
# examples: |
# - Sleeveless(tank)
# - Short Sleeve(halfway between shoulder & elbow)
# - Medium Sleeve(appx to the elbow)
# - 3/4 Sleeve(halfway between elbow & wrist)
# - Long Sleeve(to wrist)
# - intent: dress_length
# examples: |
# - mini
# - above the knee
# - knee length
# - midi
# - maxi
# - floor
- intent: pattern
examples: |
- animal print
- batik
- floral
- plaid
- polka
- dot
version: "2.0"
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: welcome user
conversation_start: true # this rule only applies at the beginning of a conversation
steps:
- intent: welcome_message
- action: utter_welcome
version: "2.0"
stories:
#- story: happy path
#steps:
#- intent: greet
# - action: utter_greet
# - intent: need_help
# - action: utter_happy
# - story: sad path 2
# steps:
# - intent: greet
# - action: utter_greet
# - intent: mood_unhappy
# - action: utter_check_these
# - action: utter_did_that_help
# - intent: deny
# - action: utter_goodbye
# - story: finding another item(upper)
# steps:
# - intent: greet
# - action: utter_greet
# - intent: need_help
# - action: utter_question_about_showed_items
# - intent: not_satisfied
# - action: utter_question_about_looking_for_female
# - intent: female_cloth
# # - action: utter_sleeve_length
# # - intent: female_cloth
# # - action: utter_sleeve_type
# # - intent: female_cloth
# # - action: utter_collar_type
# # - intent: female_cloth
# # - action: utter_fabric_type
# # - intent: female_cloth
# # - action: utter_desired_color
# # - intent: colors
# - action: utter_prefered_pattern
# - intent: pattern
# - action: utter_check_these_dress1
# - intent: affirm
# - action: utter_did_that_help
# - intent: affirm
# - action: utter_thanks
# - story: another help
# steps:
# - intent: greet
# - action: utter_greet
# - intent: need_help
# - action: utter_question_about_showed_items
# - intent: satisfied
# - action: utter_exactly_looking_for_female
- story: finding another item(blue dress)
steps:
- intent: greet
- action: utter_greet
- intent: need_help
- action: utter_question_about_showed_items
- intent: not_satisfied
- action: utter_question_about_looking_for_female
- intent: female_dress
- action: utter_sleeve_length
- intent: sleeves_length_dress
- action: utter_sleeve_type
- intent: sleeves_type_dress
- action: utter_collar_type
- intent: collar_type_dress
- action: utter_desired_color
- intent: color_dress
# - action: utter_prefered_pattern
# - intent: pattern_dress
- action: utter_check_these_dress1
- action: utter_check_these_dress2
- intent: affirm
- action: utter_check_these_dress3
- intent: affirm
- action: utter_did_that_help
- intent: affirm
- action: utter_thanks
- story: finding blouse
steps:
- intent: greet
- action: utter_greet
- intent: need_help
- action: utter_question_about_showed_items
- intent: not_satisfied
- action: utter_question_about_looking_for_female
- intent: female_blouse
- action: utter_sleeve_length
- intent: sleeves_length_dress
- action: utter_sleeve_type
- intent: sleeves_type_dress
- action: utter_collar_type
- intent: collar_type_blouse
- action: utter_desired_color
- intent: color_blouse
# - action: utter_prefered_pattern
# - intent: pattern_dress
- action: utter_check_these_dress11
- action: utter_check_these_dress22
- intent: affirm
- action: utter_check_these_dress33
- intent: affirm
- action: utter_did_that_help
- intent: affirm
- action: utter_thanks
version: "2.0"
actions:
- action_find_cloth
entities:
- pattern
intents:
- greet
- goodbye
- affirm
- deny
- mood_great
- mood_unhappy
- bot_challenge
- welcome_message
- need_help
- not_needed_help
- satisfied
- not_satisfied
- colors
- pattern
- female_dress
- female_cloth
- sleeves_length_dress
- sleeves_type_dress
- collar_type_dress
- color_dress
- pattern_dress
- female_blouse
- collar_type_blouse
# - female_cloth
# - male_cloth
# - sleeves_length
# - dress_length
# - pattern
responses:
utter_greet:
- text: "👋 Hello, I`m Sara.\n
\t Your sales assistant.\n
\t Do you need any help?"
utter_question_about_showed_items:
- text: "Did you find your desired cloth from our fitting room? 😃"
utter_question_about_looking_for_female:
- text: "Don`t worry 🙂 \n
I can help you.\n
What kind of item you are looking for? 👗👚"
buttons:
- title: "Dress"
payload: "/female_dress"
- title: "Blouse"
payload: "/collar_type_blouse"
- title: "Shirt"
payload: "/female_cloth"
- title: "T-Shirt"
payload: "/female_cloth"
- title: "Coat"
payload: "/female_cloth"
- title: "Skirt"
payload: "/female_cloth"
- title: "Pant"
payload: "/female_cloth"
button_type: reply
# - title: "Jean"
# payload: "/not_satisfied"
# - title: "Short"
# payload: "/not_satisfied"
##TODO
utter_question_about_looking_for_male:
- text: "Then, what kind of item you are looking for?🙄"
utter_preffered_trouser_type:
- text: "What is the preferred trouser type?"
buttons:
- title: "Straight"
payload: "/female_cloth"
- title: "Skinny"
payload: "/female_cloth"
- title: "Boot Cut"
payload: "/female_cloth"
- title: "Wide Leg"
payload: "/female_cloth"
- title: "Sailor Pants"
payload: "/female_cloth"
- title: "Hot Pants"
payload: "/female_cloth"
button_type: reply
utter_sleeve_length:
- text: "Can you tell me the sleeves length?"
buttons:
- title: "Sleeveless(tank)"
payload: "/female_cloth"
- title: "Short Sleeve(halfway between shoulder & elbow)"
payload: "/sleeves_length_dress"
- title: "Medium Sleeve(appx to the elbow)"
payload: "/female_cloth"
button_type: reply
utter_sleeve_type:
- text: "What kind of sleeve?"
buttons:
- title: "Sleeveless"
payload: "/female_cloth"
- title: "Short"
payload: "/sleeves_type_dress"
- title: "Puffed"
payload: "/female_cloth"
- title: "Puffed"
payload: "/female_cloth"
button_type: reply
utter_collar_type:
- text: "Can you tell me the collar type?"
buttons:
- title: "With Collars"
payload: "/female_cloth"
- title: "Collar Less"
payload: "/collar_type_dress"
button_type: reply
utter_fabric_type:
- text: "What is your preferred fabric type?"
buttons:
- title: "Chiffon"
payload: "/female_cloth"
- title: "Crochet"
payload: "/female_cloth"
- title: "Flannel"
payload: "/female_cloth"
- title: "Fleece"
payload: "/female_cloth"
- title: "Jersey"
payload: "/female_cloth"
button_type: reply
utter_dress_length:
- text: "What is your preferred dress length?"
buttons:
- title: "Mini"
payload: "/female_cloth"
- title: "Above the knee"
payload: "/female_cloth"
- title: "Knee length"
payload: "/female_cloth"
- title: "Midi"
payload: "/female_cloth"
button_type: reply
utter_desired_color:
- text: "Can you plz mention the desired color?"
utter_prefered_pattern:
- text: "What kind of pattern do you prefer?"
buttons:
- title: "Animal print"
payload: "/female_cloth"
- title: "Batik"
payload: "/female_cloth"
- title: "Floral"
payload: "/female_cloth"
- title: "Polka"
payload: "/pattern_dress"
button_type: reply
utter_check_these_dress1:
- text: "Okay cool 😎\n
Check these out 👀"
image: "https://ibb.co/KD60PNd"
utter_check_these_dress2:
- text: "Do you want to see more? 😉"
buttons:
- title: "Yes 🙂"
payload: "/affirm"
- title: "No 🙁"
payload: "/affirm"
button_type: reply
utter_check_these_dress3:
- text: "What about this? 👀 \n
Do you like it?"
image: "https://ibb.co/CQfJcbL"
buttons:
- title: "Yes 🙂"
payload: "/affirm"
- title: "No 🙁"
payload: "/affirm"
button_type: reply
utter_check_these_dress11:
- text: "Okay cool 😎\n
Check these out 👀"
image: "https://ibb.co/PQkDWNk"
utter_check_these_dress22:
- text: "Do you want to see more? 😉"
buttons:
- title: "Yes 🙂"
payload: "/affirm"
- title: "No 🙁"
payload: "/affirm"
button_type: reply
utter_check_these_dress33:
- text: "What about this? 👀 \n
Do you like it?"
image: "https://i.ibb.co/dmtTXF1/2320-1.jpg"
buttons:
- title: "Yes 🙂"
payload: "/affirm"
- title: "No 🙁"
payload: "/affirm"
button_type: reply
utter_going_to_suggest:
- text: "Okay, select your desired item from the fitting room and I`ll find a best matching lower or upper cloth item which make a suit of clothes"
utter_prefered_item_upper:
- text: "What is your preferred item?"
buttons:
- title: "Skirt"
payload: "/female_cloth"
- title: "Trouser"
payload: "/female_cloth"
button_type: reply
utter_did_that_help:
- text: "Was my selections helpful? 🙄"
buttons:
- title: "Yes, great! 👍"
payload: "/affirm"
- title: "No, not much 👎"
payload: "/affirm"
button_type: reply
utter_happy:
- text: "Whats your problem"
utter_thanks:
- text: "Great! 👍\n
Thanks for shopping with us 🙏\n
Have a nice day ⛅"
utter_another_chance:
- text: "Then give me another chance"
- text: "Can u plz check these out"
image: "https://i.imgur.com/nGF1K8f.jpg"
utter_goodbye:
- text: "Bye"
utter_iamabot:
- text: "I am a bot, powered by Rasa."
utter_greeting:
- text: "Hello, I`m Sara."
utter_welcome:
- text: Hi there! What can I help you with today?
utter_exactly_looking_for_female:
- text: "Then, Can u tell me exactly what are u looking for?"
buttons:
- title: "Suggestion for a suit"
payload: "/female_cloth"
- title: "Recommendation from previous customers"
payload: "/female_cloth"
button_type: reply
session_config:
session_expiration_time: 60
carry_over_slots_to_new_session: true
slots:
pattern:
type: unfeaturized
# 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: <host of the redis instance, e.g. localhost>
# port: <port of your redis instance, usually 6379>
# db: <number of your database within redis, e.g. 0>
# password: <password used for authentication>
# use_ssl: <whether or not the communication is encrypted, default false>
#tracker_store:
# type: mongod
# url: <url to your mongo instance, e.g. mongodb://localhost:27017>
# db: <name of the db within your mongo instance, e.g. rasa>
# username: <username used for authentication>
# password: <password used for authentication>
# 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
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment