📺bilibili • 🌐 Github •
👋 If you like it, please give a little star in the top right corner. ⭐
Read this in Chinese.
This is a demonstration of using the OpenAI Assistant API, including complete front-end and back-end code.
In my childhood, a black cat brought me a lot of joy.
His eyes were like an entire universe, and his black fur would shimmer with a purplish-gold hue under the sunlight, looking particularly beautiful.
This cat was extremely lively, with a loud and piercing meow, full of energy, visible to the neighbors on the hill behind during the day.
Every day after school, as soon as I opened the door, he would run down from the platform of my house to play with me.
Unfortunately, he later accidentally ate rat poison from a neighbor's house and left me too soon.
This project is the "Curious Black Cat" built using OpenAI's Assistant API.
He is full of curiosity about the world and appears in a city in China every day. If I miss him, he can also send me his current picture.
I know that today's technology has a very grand and vast significance for the future, to the extent that people in the future, when reminiscing about their childhood like I do, may fondly remember an AI agent that accompanied them through their childhood.
And on this weekend evening, I just suddenly missed my old friend from my childhood again.
First, modify the API KEY in .env
- OPENAI_API_KEY from API keys - OpenAI API
- NINJAS_API_KEY from API Ninjas
- Install anaconda or miniconda: search for installation methods
- Create a Python virtual environment
conda create -n cat python=3.11
- Enter the Python virtual environment
conda activate cat
- Install project dependencies
cd server
pip install -r requirements.txt
- Start the backend server
python run.py
- Install Node.js: search for installation methods
- Install dependencies
cd web
npm i
# or
yarn
- Run the frontend web
npm run dev
# or
yarn dev
Open a browser and enter the address: 127.0.0.1:3000
If using WSL (Windows Subsystem for Linux), please modify 127.0.0.1
in the code to the host IP address accordingly.