'RASA - rasa run actions - localhost issues
I am learning Rasa using the RASA masterclass youtube channel. https://www.youtube.com/channel/UCJ0V6493mLvqdiVwOKWBODQ
It has all worked until it has come to loading actions. Each time I use rasa run actions in the command prompt (the first of the two actions) the program gets stuck and I have to manually kill it. When I use rasa shell --endpoints endpoints.yml, bot works however as I keep encountering when I add in a custom action the server returns cannot connect to localhost like in the bottom example. The question is how to I get passed this issue.
*Please ask for additional info
my actions.py looks like the below:
from typing import Any, Text, Dict, List
from rasa_sdk import Action, Tracker
from rasa_sdk.executor import CollectingDispatcher
from rasa_sdk.events import SlotSet
class ActionFacilitySearch(Action):
def name(self) -> Text:
return "action_facility_search"
def run(self, dispatcher: CollectingDispatcher,
tracker: Tracker,
domain: Dict[Text, Any]) -> List[Dict[Text, Any]]:
facility = tracker.get_slot("facility_type")
address = "300 Hyde St, San Francisco"
dispatcher.utter_message("Here is the address of the {}:{}".format(facility, address))
return []
in domain.yml, for the actions section I have;
actions:
- utter_greet
- utter_cheer_up
- utter_did_that_help
- utter_happy
- utter_goodbye
- utter_iamabot
- utter_ask_location
- action_facility_search
and in endpoints.yml, most is #'d out but the active bit is:
action_endpoint:
url: "http://localhost:9000/webhook"
Solution 1:[1]
Please do not change endpoints.yml with any other port for action_endpoint
Please check with 5055 port it was working perfectly.
action_endpoint:
url: "http://localhost:5055/webhook"
Your action server running on 5055 port. if you want it to set 9000 then change it from rasa core backend request.
Solution 2:[2]
it looks like your custome actions server couldn't able to connect with the endpoint server which is mentioned in endpoints.yml
While running actions.py provide the port number as rasa run actions -p portnumber
Make sure the port number you give here is mentioned in endpoints.yml
Solution 3:[3]
I solve by using the following commands
rasa run actions
Then a second window for either:
rasa x
this then worked as it should.
Solution 4:[4]
By looking at the given image, I am assuming that you want to run the action server on port 9000.
If you do want to run action server on port 9000, then you need to make these changes:
endpoints.yml:
action_endpoint:
url: "http://localhost:9000/webhook"
Command to run action server:
rasa run actions -p 9000 --debug
user --debug option too check is there issue in action file.
Solution 5:[5]
In terminal 1 run
rasa actions
In terminal 2 run Check you have the model inplace inside the models folder if it is not there use
rasa train
Then run
rasa shell --endpoints endpoints.yml
Solution 6:[6]
I answered my question. I ended up using an if statement to return the days in a positive number:
Z - date = if(today()>'LSI DP_JP_HistorySummaryBySiteMaster'[Z Date],today()-'LSI DP_JP_HistorySummaryBySiteMaster'[Z Date])
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | vishal bareja |
| Solution 2 | VIMAL KUMAR |
| Solution 3 | Ankit Singh |
| Solution 4 | Anurag A S |
| Solution 5 | |
| Solution 6 | Vimal Patel |

