Python AI: How to build a simple AI in 4 lines of Python code using CHAIPY

Will Beauchamp
2 min readApr 28, 2021

--

(this tutorial is based off the example from https://chai.ml)

##################

🚀 🚀🚀🚀🚀🚀

##################

  1. Install Python3
  2. 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.
  3. 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/

--

--

Will Beauchamp
Will Beauchamp

Written by Will Beauchamp

Cambridge University PhD in Machine Learning

No responses yet