Not able to connect to ACTION SERVER
See original GitHub issueI have created actions.py file in the same folder where all my other files - domain.yml, policies.yml etc are located. But while running the bot I’m encountering the following error:
2019-06-27 16:38:33 ERROR rasa_core.actions.action - Failed to run custom action 'Repayment_form'. Couldn't connect to the server at 'http://0.0.0.0:5055'. Is the server running? Error: HTTPConnectionPool(host='0.0.0.0', port=5055): Max retries exceeded with url: / (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x000001CCCF4CEDA0>: Failed to establish a new connection: [WinError 10049] The requested address is not valid in its context')) 2019-06-27 16:38:33 ERROR rasa_core.processor - Encountered an exception while running action 'Repayment_form'. Bot will continue, but the actions events are lost. Make sure to fix the exception in your custom code.
This is my domain file:
domain_bot_action.txt
This is my stories file
stories_bot_action.txt
My actions.py file looks like this.
`from typing import Dict, Text, Any, List, Union, Optional
from rasa_sdk import Tracker
from rasa_sdk.executor import CollectingDispatcher
from rasa_sdk.forms import FormAction
class RepaymentForm(FormAction):
def name(self) -> Text:
return "Repayment_form"
def required_slots(tracker: Tracker) -> List[Text]:
return ["sub_class"]
def slot_mappings(self) -> Dict[Text, Union[Dict, List[Dict]]]:
return {"sub_class": [self.from_text()],}
def db() -> List[Text]:
return ['pre-close','pre-closure','preclose','preclosure', 'pre close', 'no' , 'loan repayment
methods', 'repay loan methods', 'interest rate', 'interest']
def validate_sub_class( self, value: Text, dispatcher: CollectingDispatcher, tracker: Tracker,
domain: Dict[Text, Any],) -> Optional[Text]:
if value.lower() in self.db:
return {"sub_class" : value}
else:
dispatcher.utter_template("utter_wrong_format", tracker)
return {"sub_class": None}
def submit(self,dispatcher: CollectingDispatcher,tracker: Tracker, domain: Dict[Text, Any],) -
> List[Dict]:
"""Define what the form has to do
after all required slots are filled"""
# utter submit template
dispatcher.utter_template("utter_submit", tracker)
return []`
This is how the bot has responded to other inputs. It’s successfully running but it fails as soon as it has to perform any custom action
Issue Analytics
- State:
- Created 4 years ago
- Comments:19 (6 by maintainers)
Top GitHub Comments
What about your endpoints.yml? Make sure that you uncomment the following lines:
Also, you did not mention if you made sure to run the action server by
rasa run actions
@Shivappa This isn’t a Rasa bug. You could post it on the Rasa forum or an Azure forum.