Python AI: How to build a simple AI in 4 lines of Python code using CHAIPY
2 min readApr 28, 2021
(this tutorial is based off the example from https://chai.ml)
##################
🚀 🚀🚀🚀🚀🚀
##################
- Install Python3
- Go to https://chai.ml/dev and sign in. At the bottom is your personal DEVELOPER_KEY and DEVELOPER_UID. You will need these later.
- Copy this code
# install the python package that will allow us to build our bots
pip install --upgrade chaipy# download the chai bot template
git clone https://github.com/chai-nexus/chai_quickstart.git # move into new repo
cd chai_quickstart# edit the file uploader.py setting the correct values for DEVELOPER_KEY and DEVELOPER_UID# Upload your template bot! (I had to wait about a minute for mine to upload)
python uploader.py
4. When the QR code pops up take a picture with your phone. This will launch the CHAI app — sign in — talk to your bot!
5. Bonus: now you can begin tweaking your bot & redeploying it & sharing with friends.
Links for more info:
- https://chai.ml/docs/