|
|
7 months ago | |
|---|---|---|
| .. | ||
| README.md | 7 months ago | |
README.md
Run code
Set up
Create virtual environment
python -m venv venv
source ./venv/bin/activate
Install dependencies
pip install openai fastapi uvicorn python-dotenv
Run API
# Method 1: Run am direct
python api.py
# Method 2: Use uvicorn
uvicorn api:app --host 0.0.0.0 --port 5000 --reload
Test API
Visit di interactive API documentation for: http://localhost:5000/docs
Run frontend
Make sure say you dey for di frontend folder
Find app.js, change BASE_URL to ur backend URL
Run am
npx http-server -p 8000
Try type message for di chat, you go see response (if you dey run am for Codespace or you don set up access token).
Set up access token (if you no run dis for Codespace)
See Set up PAT
Disclaimer: Dis document na AI translation service Co-op Translator wey translate am. Even though we try make am correct, abeg sabi say automated translation fit get mistakes or no too correct. Di original document for e own language na di real correct one. If na serious matter, e better make person wey sabi human translation do am. We no go hold ourselves responsible if person no understand or misinterpret from dis translation.