Ask questions and join our Discord!
pip install chaipy
- Get the Chai app.
- Sign in to Chai Developer Platform.
- Scroll to the bottom and get your "Developer Unique ID" and "Developer Key".
- Git clone the starter repo with
git clone https://github.com/chai-nexus/chai_quickstart.git
A Minimal Chat AI
- Open the file
uploader.pyusing your text editor.
DEVELOPER_UID = None # SET THIS VALUEDEVELOPER_KEY = None # SET THIS VALUEif 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!
- Set your
starter_bot.pyand change "Hi I’m an ExampleBot" to "I love AI".
from chai_py import ChaiBot, Updateclass 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 MESSAGECopied!
- Press Y when prompted, as this is a new bot. Next time we will press N.
- 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.
- Chat with your bot!