Hello, I’m facing some issues with syntax error with custom actions in rasa open source , please help me out . I have attached files related to this issue
## this is the actions.py file
from typing import Any, Text, Dict, List
from rasa_sdk import Action, Tracker
from rasa_sdk.executor import CollectingDispatcher
class area_options(Action):
def name (self) -> Text:
return "action_area_buttons"
def run(self, dispatcher: CollectingDispatcher, tracker: Tracker, domain: Dict[Text,Any]) -> List[Dict[Text, Any]]:
value = tracker.get_slot("area_travel")
if value == 'Domestic':
dispatcher.utter_message(response= "utter_domestic_packages")
elif value == 'International':
dispatcher.utter_message(response= "utter_international_packages")
## this is the error log
Traceback (most recent call last):
File "/home/venkat/Desktop/Rasa/Rasaproject/bin/rasa", line 5, in <module>
from rasa.__main__ import main
File "/home/venkat/Desktop/Rasa/Rasaproject/lib/python3.8/site-packages/rasa/__main__.py", line 10, in <module>
import rasa.telemetry
File "/home/venkat/Desktop/Rasa/Rasaproject/lib/python3.8/site-packages/rasa/telemetry.py", line 18, in <module>
import requests
File "/home/venkat/Desktop/Rasa/Rasaproject/lib/python3.8/site-packages/requests/__init__.py", line 116
from .__version__ import __- title__, __description__, __url__, __version__
^
SyntaxError: invalid syntax
Yes you can use a regular Python virtual environment or even no virtual environment at all (not recommended if you want to have multiple Python projects).
Just try to create a fresh venv and do:
pip install rasa rasa-x -i https://pypi.rasa.com/simple
If you get any error (in red) that you cannot solve, please get back to us.