pip3 install virtualenv
virtualenv chatbot
source chatbot/Scripts/activate
pip3 install -r requirements.txt
replace OPENAI_API_KEY=${REPLACE_WITH_KEY}
python app.py
login api: http://localhost:5000/api/discordLogin test api: https://localhost:5000/api/test logout api: http://localhost:5000/api/discordLogout home: https://localhost:5000/
cd /var/tmp && sudo rm -rf * course_chatbot_app
git clone https://github.com/Moshiii/course_chatbot_app.git
sudo cp -r /var/tmp/course_chatbot_app/* /opt/chatbot
sudo systemctl restart chatbot.service
sudo cp -r /var/tmp/course_chatbot_app/.env /opt/chatbot
cd /opt/chatbot source chatbot/bin/activate sudo pip install -r requirements.txt
sudo journalctl -u chatbot.service
https://discord.com/developers/applications
- 点new application, 输入一个name, create
- 选择oauth2,记录client id
- client secret 选reset secret,记录下client secret
- add redirect: https://ec2-44-212-203-117.compute-1.amazonaws.com:5000/api/discordLogin/callback
- 登录discord,右键点server, server settings, 找到widget, copy server id
- update CLIENT_ID, CLIENT_SECRET in https://github.com/Moshiii/course_chatbot_app/blob/main/.env
- update group id in https://github.com/Moshiii/course_chatbot_app/blob/main/app.py#L28 with server id
npm run build之后 用winscp copy dist 到 ec2 /var/tmp底下 然后进入aws console,ssh到 ec2 cd /usr/share/nginx/html/ && sudo rm -rf dist/ && sudo cp -r /var/tmp/dist/ .
notes about syllabus prompt feedback button log all conversation
attatch some links from wiki after the answer.
focus: based on a user input, first API call: the query is vecrotized and compare the cosine similarity with the context vectors the top context will be provided along with the query to get the answer. second API call: ask chatgpt to extract the keywords from the question and call wikipedia APi to get the page content third API call: ask chatgpt to summerize/extract key infomation form the wiki pages
return answer fron call2 + call3
exploration : based on a user input, first API call: the query is vecrotized and compare the cosine similarity with the context vectors the top context will be provided along with the query to get the answer. second API call: ask chatgpt to extract the top3 keywords from the respons and call wikipedia APi to get the page content ping the link, if exist then return it.
return return answer fron call2 + call3 links
two respond style focus vs comprehensive/exploraion
UI interface :
chatting: background to give a feeling of professor office/class room or a background of professor in a laptop and a conversation interface on the left is a professor standing up in front of a blackboard on the right is a student raing their hand
have a feeling of in a class
landing page: exiting technology about machanical engineering a picture of prof and welome message in the landing page saying well come to my office I am happy to answer you question ...
at the landing page, befor direct to the authepage. a popup says: In using the system,the student code of conduct apply, please do not abuse the system. Please always refer to you study material and textbook for answer and verification of the correctness of the answer the system provides.