Getting Started

Support

Ask questions and join our Discord!

Installation

  1. pip install chaipy
  2. Get the Chai app.
  3. Sign in to Chai Developer Platform.
  4. Scroll to the bottom and get your "Developer Unique ID" and "Developer Key".
  5. Git clone the starter repo with git clone https://github.com/chai-nexus/chai_quickstart.git

A Minimal Chat AI

  1. cd chai_quickstart
  2. Open the file uploader.py using your text editor.
DEVELOPER_UID = None # SET THIS VALUE
DEVELOPER_KEY = None # SET THIS VALUE
if DEVELOPER_KEY is None or DEVELOPER_UID is None:
raise RuntimeError("Please fetch your UID and KEY from the bottom of the Chai Developer Platform. https://chai.ml/dev")
Copied!
  1. Set your DEVELOPER_UID and DEVELOPER_KEY.
  2. Open starter_bot.py and change "Hi I’m an ExampleBot" to "I love AI".
from chai_py import ChaiBot, Update
class Bot(ChaiBot):
def setup(self):
self.logger.info("Setting up...")
async def on_message(self, update: Update) -> str:
return "Hi, I'm ExampleBot." # EDIT THIS MESSAGE
Copied!
  1. Run python uploader.py.
  2. Press Y when prompted, as this is a new bot. Next time we will press N.
  3. You’ll get a QR code. First install the Chai app, and then scan the QR code. This will allow you to open the app so you can speak to your chat AI.
  4. Chat with your bot!