You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Web-Dev-For-Beginners/translations/en/9-chat-project/solution/backend/python/README.md

1.5 KiB

Run code

Set up

Create a virtual environment

python -m venv venv
source ./venv/bin/activate

Install dependencies

pip install openai flask flask-cors 

Run API

python api.py

Run frontend

Make sure you're in the frontend folder.

Find app.js and update BASE_URL to match your backend URL.

Run the application.

npx http-server -p 8000

Try typing a message in the chat; you should see a response (as long as you're running this in a Codespace or have set up an access token).

Set up access token (if you're not running this in a Codespace)

Refer to Set up PAT


Disclaimer:
This document has been translated using the AI translation service Co-op Translator. While we aim for accuracy, please note that automated translations may include errors or inaccuracies. The original document in its native language should be regarded as the authoritative source. For critical information, professional human translation is advised. We are not responsible for any misunderstandings or misinterpretations resulting from the use of this translation.