-1

I am encountering an issue with my Rasa chatbot where the conversation flow gets blocked at the "provide_employee_id" action in the stories "User Chooses Efficiency Calculation day," "User Chooses Efficiency Calculation - Month," and "User Chooses Efficiency Calculation - week." The conversation does not continue to the next utterance as expected.

Here is an overview of the relevant components in my project:

Rasa Version: [Specify your Rasa version] Stories: I have defined stories for different user interactions, including scenarios where the bot needs to gather an employee ID from the user. Actions: I have an "action_get_employee_id" action that queries a database to retrieve the employee ID and returns it as a slot. Domain: I have defined slots, intents, and actions in my domain file. Pipeline: I'm using a pipeline configuration with different NLU and Core components. I have thoroughly reviewed my code, including the action implementation, database query, and slot mappings. However, the issue persists, and the bot gets stuck at the "provide_employee_id" action.

I have also tried using the interactive learning feature to debug the issue but haven't been able to identify the root cause.

Could someone please help me troubleshoot this issue? Any insights, suggestions, or debugging tips would be greatly appreciated. I'm happy to provide more code snippets, configuration details, or logs if needed.

Thank you in advance for your assistance!

stories.yml version: "3.1"

stories:

story: efficiency calculation steps: intent : efficiency action : utter_calculation_efficiency

story : efficiency choice steps : intent : efficiency_per action : get_efficiency_choice

story: User Chooses Efficiency Calculation day steps:
intent : efficiency_per_day1 action : utter_efficiency_per_day action : utter_request_id_employee intent : provide_employee_id action : action_get_employee_id action : utter_ask_date intent : provide_specific_date action : action_get_specific_date action : get_efficiency

story: User Chooses Efficiency Calculation - Month steps: intent : efficiency_per_month1 action : utter_efficiency_per_month
action : utter_request_id_employee intent : provide_employee_id action : action_get_employee_id action : utter_get_start_date intent : provide_start_date action : action_get_start_date action : utter_get_end_date intent : provide_end_date action : action_get_end_date action: get_efficiency

story: User Chooses Efficiency Calculation - week steps: intent: efficiency_per_week1 action : utter_efficiency_per_week action : utter_request_id_employee intent : provide_employee_id action : action_get_employee_id action : utter_get_start_date intent : provide_start_date action : action_get_start_date action : utter_get_end_date intent : provide_end_date action : action_get_end_date action: get_efficiency

story: User Chooses Error Calculation steps: intent : errors action: get_errors

story : toutes les features steps : intent : present_the_features action : utter_info domain.yml

version: "3.1"

intents:

salutation greet present_the_features goodbye confirmation nothing deny thank provide_employee_id provide_specific_date
efficiency_per_month efficiency_per_week efficiency_per_day out_of_scope calculation_error
calculation_efficiency provide_start_date provide_end_date

entities: time_frame error efficiency employee_id start_date end_date specific_date

slots : time_frame : type: categorical values : month week day mappings: type : from_entity entity : time_frame employee_id : type: text mappings: type : custom action : action_get_employee_id

specific_date : type : text mappings : type : custom action : action_get_Specific_Date

errors: type: text
mappings: type: custom action: get_errors

efficiency: type : text mappings: type: custom action : get_efficiency

end_date : type : text mappings: type: custom action : action_get_end_date

start_date : type : text mappings: type: custom action : action_get_start_date

responses: utter_greeting: text : "Hello and welcome to kaschke! I am your virtual assistant." utter_salutation: text : " Hello! how can I help you ? " utter_info : text : > I am delighted to be able to help you and accompany you through the different options available:
buttons : title : "efficiency" payload : '/efficiency' title : " errors " payload : '/errors' utter_calculation_efficiency: text: >
the calculation of efficiency per: buttons : title : "month" payload : '/efficiency{{"time_frame":"month"}}' title : "week" payload : '/efficiency{{"time_frame": "week"}}' title : "day" payload : '/efficiency{{"time_frame": "day"}}' #utter_question: text: "What do you want to know about this topic?" utter_goodbye: text: "Bye" utter_thank: text : "You’re welcome! Do you have any other questions?" utter_confirmation: text: "All right, how can I help you now?" utter_help: text: "Okay, feel free to ask me more questions if you need further clarification or information!" utter_nothing: text: "Perfect!" utter_request_id_employee: text : Could you give me an employee ID so I can send you the employee’s efficiency?" utter_default: text: "I am sorry, I did not understand your request" utter_ask_Specific_Date: text: "Sure! Please provide the date in the format dd/mm/yyyy or dd-mm-yyyy."

utter_errors : text : "you want to the errors in the database "
utter_efficiency_per_month : text : "To calculate the efficiency per month, you should provide an ID of the employee and the month." utter_efficiency_per_week : text : "To calculate the efficiency per week, you should provide an ID of the employee and the number of the week." utter_efficiency_per_day : text : "To calculate the efficiency per week, you should provide an ID of the employee and the specific Date." utter_get_id : text : "give me the ID of employee" utter_get_start_date: text : "give me the start date " utter_get_end_date : text : "give me the end date " actions: action_get_employee_id get_errors action_greet get_efficiency action_get_start_date action_default utter_get_id utter_ask_Specific_Date utter_errors action_get_end_date action_get_start_date utter_get_end_date utter_get_start_date utter_request_id_employee

session_config: session_expiration_time: 60 carry_over_slots_to_new_session: true events : ActionExecuted

nlu.yml version: "3.1"

nlu: intent: greet examples: | hey hello hi hello there hey there let's go hey dude good afternoon

intent: salutation examples: | greeting good morning good evening

intent: goodbye examples: | cu good by cee you later good night bye goodbye have a nice day see you around bye bye see you later

intent : efficiency_per examples: | can you give me the efficiency per month . can you give me the efficiency per day. calculate the efficiency per week. calculate the efficiency per day. I want to know the efficiency per week. I want to know the efficiency per day.

intent: present_the_features examples: | what are you presenting? what do you got? what are you doing? What do you propose? Can you give me a sense of what you are presenting? What are your products or services?

intent : efficiency examples: | can you give me the efficiency ? I want to calculate the efficiency can you tell me the efficiency of the employee ? how can I calculate the efficiency of employees give options for calculating efficiency

intent : errors examples: | can you give me the errors ? I want to calculate the errors can you tell me the errors in the database ? how can I see the errors in the database I want to know the mistakes in the data base please ?

intent : confirmation examples: | Agreed ok of course well

intent : nothing examples: | nothing all is well

intent: deny examples: | no n never I don't think so don't like that no way not really

intent: thank examples: | thank you thanks thank you very much be great thank you, bye thanks by

intent : provide_employee_id examples: | 10001 20554 10002 19622 10003 11558 10004 88421 10005 16231 10008 10009 10012 10013 12555 10073 10076 10077 10078 10082 10101 10181 11181 12005 12009 12079

intent : provide_specific_date examples: | 2022-09-10 2022-09-15 2023-11-09 2022-01-13 22/10/2015 1-10-2023 2023-01-01

intent : efficiency_per_week1 examples: | What was the overall efficiency for the week ? How productive were the employees throughout the week ? Provide me the weekly efficiency for the week . I want to calculate the efficiency of this week . What is the efficiency of the team for the week ? Compare the efficiency of different teams for the week . Can you show me the efficiency of the week ? What was the efficiency of employees for the week?" Give me the weekly efficiency report for the week. Provide me the efficiency for the week . How productive were we in that week ? What is the efficiency for the week ? I want to know the efficiency on the week . What was the efficiency on this week? Give me the efficiency in the week .

intent : efficiency_per_month1 examples: | Give me the efficiency for all the days in month. How productive were the employees throughout month? Provide me the monthly efficiency for month. I want to know the efficiency on the 1st of month. Tell me the efficiency for the entire month. What is the average efficiency of the team for month? Compare the efficiency of different teams for month. Can you show the efficiency trend for month? What was the efficiency of employee John in month? Give me the monthly efficiency report for month. Provide me the efficiency per day for month. how productive were we on the 15th of month? What is the efficiency for month? I want to know the efficiency on month. Tell me the efficiency for the entire month. Compare the efficiency of different teams for month. Can you show the efficiency trend for month?" What was the efficiency during month?"

intent : efficiency_per_day1 examples: | What was the efficiency of day? Give me the efficiency day. How productive were the employees on the day? Provide me the efficiency for the day. I want to know the efficiency on the day. Tell me the efficiency for the day. What is the average efficiency of the day.

intent : provide_start_date examples : | 2022-11-30 from 2023-03-03 2023-02-02 2023-05-05 2022-08-20

intent : provide_end_date examples : | 2023-08-04 to 2023-06-10 2023-07-20 2023-09-15 2023-10-25

intent : out_of_scope examples : | I have nothing to do. I am sick. In short. Need service. action.py class ActionGetEmployeeID(Action): def name(self) -> Text: return "action_get_employee_id"

def run(self, dispatcher: CollectingDispatcher, tracker: Tracker, domain: Dict[Text, Any]) -> List[Dict[Text, Any]]: Récupérer employee_id (person) entré par l'utilisateur employee_id = tracker.latest_message['text'] if not employee_id: dispatcher.utter_message(text="Please provide an employee ID.") return []

Connexion à la base de données cnx = mysql.connector.connect(user='root', password='root', host='localhost', database='database', port='3306') cursor = cnx.cursor() Exécution de la requête pour vérifier si l'ID employee (person) est disponible dans la base de données query = "SELECT * FROM Productivity WHERE Person = '{}'".format(employee_id) cursor.execute(query) Récupération du résultat de la requête result = cursor.fetchone()

if not result: dispatcher.utter_message(text="Employee ID not found in the database.") return [] else: Stocker l'employee_id dans un slot pour une utilisation ultérieure return [SlotSet("employee_id", employee_id)]

config.yml

The config recipe. https://rasa.com/docs/rasa/model-configuration/ recipe: default.v1

The assistant project unique identifier This default value must be replaced with a unique assistant name within your deployment assistant_id: 20230707-175235-glad-pond

Configuration for Rasa NLU. https://rasa.com/docs/rasa/nlu/components/ language: en

pipeline: name: WhitespaceTokenizer name: RegexFeaturizer name: LexicalSyntacticFeaturizer name: CountVectorsFeaturizer name: SpacyNLP name: SpacyTokenizer name: CRFEntityExtractor 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.5 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: TEDPolicy max_history: 5 epochs: 100 name: RulePolicy core_fallback_threshold: 0.5 core_fallback_action_name: "action_default" enable_fallback_prediction: True name: UnexpecTEDIntentPolicy max_history: 5 epochs: 100

I want to resolve this problem

  • Hi, Malek! Unfortunately, your question is very unlikely to get an answer given its current length: you might find this helpful in trimming it down: https://stackoverflow.com/help/minimal-reproducible-example Also, here are the guidelines on how to format code for best readability: https://meta.stackoverflow.com/questions/251361/how-do-i-format-my-code-blocks – Quack E. Duck Aug 10 '23 at 03:36

0 Answers0