A demonstration of a chatbot using React, FastAPI and the OpenAI API
Steps used to run the React App
cd ui
npm install
npm start
Steps to set up the Fast API server. You will need to spend $5 with OpenAI to get an API key. From there, you can get a secret key to use the API.
python3.11 -m venv .venv
. .venv/bin/activate
pip install -r requirements.txt
export OPENAI_API_KEY=secret_key
python -m uvicorn app:app --host 0.0.0.0 --port 8000
If you browse to http://localhost:3000
you will see the chatbot in action.
Steps used to create the React App
npx create-react-app ui
npm install axios