This is an example chatbot app base from the OpenAI API quickstart tutorial. It uses the Flask web framework. Chatbot can talk and reply to speech from user.
We add new feature that overcomes the weakness of ChatGPT - can't have updated information about weather, date and time with google search function.
-
If you don’t have Python installed, install it from here
-
Clone this repository
-
Navigate into the project directory
$ cd wechatbot
-
Create a new virtual environment
$ python -m venv env $ . env/bin/activate
-
Install the requirements
$ pip install -r requirements.txt
-
Make a copy of the example environment variables file
$ cp .env.example .env
-
Add your ChatGPT API key and Serp API key to the newly created
.env
file -
Addition config for Recognition Language and Synthesis Voices can find in
main.js
-
Run the app
$ flask run
You should now be able to access the app at http://localhost:5000! For the full context behind this Python example app, check out the OpenAI tutorial.