Rasa Versions: rasa-core-sdk~=0.12.2 rasa_core~=0.13.2 rasa_nlu~=0.14.4
Custom Action file action.py, having following
import logging import requests import json from rasa_core_sdk import Action logger = logging.getLogger(__name__) class ApiAction(Action): def name(self): return "action_match_news" def run(self, dispatcher, tracker, domain): response = """KK Enjoy !!""" print(tracker) dispatcher.utter_message(response) return
domain.yaml has following
actions: - utter_greet - utter_did_that_help - utter_goodbye - action_match_news - utter_default - utter_gratitude - utter_ask_again intents: - goodbye - greet - thanks - affirm - deny templates: utter_greet: - text: "Hey! What can I do for you?" utter_did_that_help: - text: "Did that help you?" - text: "I hope that solved your query" utter_goodbye: - text: "Bye" utter_default: - text: "I am sorry, I didn't get that. Could you please repeat your query?" - text: "I am not sure what you are aiming for." utter_gratitude: - text: "Glad that I could be of help to you!\nBye" utter_ask_again: - text: "Okay! Let's start again, please tell me what do you need?" - text: "No issues! Let's try this again.\n Please repeat your query?"
stories.md has following
## news path 1 * greet - utter_greet * current_matches - action_match_news - utter_did_that_help * affirm or thanks - utter_gratitude * goodbye - utter_goodbye ## news path 2 * current_matches - action_match_news - utter_did_that_help * affirm or thanks - utter_gratitude * goodbye - utter_goodbye ## news path 3 * greet - utter_greet * current_matches - action_match_news - utter_did_that_help * deny - utter_ask_again * current_matches - action_match_news - utter_did_that_help * affirm or thanks - utter_gratitude * goodbye - utter_goodbye
Getting following error
2019-10-17 18:44:10 DEBUG rasa_core.processor - Predicted next action 'action_match_news' with prob 1.00. 2019-10-17 18:44:10 DEBUG rasa_core.actions.action - Calling action endpoint to run action 'action_match_news'. 2019-10-17 18:44:10 ERROR rasa_core.actions.action - Failed to run custom action 'action_match_news'. Action server responded with a non 200 status code of 404. Make sure your action server properly runs actions and returns a 200 once the action is executed. Error: 404 Client Error: NOT FOUND for url: http://localhost:5055/ 2019-10-17 18:44:10 ERROR rasa_core.processor - Encountered an exception while running action 'action_match_news'. Bot will continue, but the actions events are lost. Make sure to fix the exception in your custom code. 2019-10-17 18:44:10 DEBUG rasa_core.processor - Failed to execute custom action.
Used example from here