This guide provides a detailed walkthrough for setting up and developing a Rasa chatbot project using Visual Studio Code (VSCode).
- Download and install VSCode from the official website: https://code.visualstudio.com/
- Ensure Python 3.10 or newer is installed on your system. Download it from https://www.python.org/.
- Open VSCode and start a new terminal session (Terminal > New Terminal).
- Create a project directory for your Rasa project files.
- Navigate to your project directory in the terminal using the
cd
command. - Create a Python virtual environment for your project:
On Windows, you might use
python3 -m venv ./rasa_venv
python
instead ofpython3
. - Activate the virtual environment:
- On Windows:
.\rasa_venv\Scripts\activate
- On macOS/Linux:
source rasa_venv/bin/activate
- On Windows:
- Install Rasa within the virtual environment:
pip install rasa==3.6.16
- In the VSCode terminal, ensure you're in your project directory and your virtual environment is activated.
- Run the following command to create a new Rasa project:
rasa init
- Follow the prompts to create the initial project structure and train a simple bot.
- Open the project directory in VSCode (File > Open Folder) to start editing your files.
- Modify the generated files to develop your chatbot's training data and logic.
- Retrain your model by running:
rasa train
- Test your chatbot by running:
rasa shell
- Edit
actions/actions.py
for custom actions. - Start the action server with
rasa run actions
.
- Initialize a Git repository and commit your changes:
git init git add . git commit -m "Initial commit"
- Continue developing your bot by adding more training data, refining the domain, and adding custom actions as needed.
- Consider installing the Python extension for VSCode.
- Refer to the Rasa Documentation for more information: https://rasa.com/docs/