Read the article to know more about this project -> https://blog.lakbychance.com/prototyping-a-qa-web-using-openai
Check out openai
cook book from where the original code is picked and modified.
- Have
python3
installed on your system. - Run
pip3 install -r requirements.txt
. - If you run into
setuptools
related error, then installsetuptools
as well.
- Add
OPENAI_API_KEY: <API TOKEN>
to.env
file. python3 server.py
would start the flask server.
Hit the http://localhost:5000/ask
route with required query params of question
and url
.
There is also an optional recursive
query parameter which is false
by default to avoid crawling other links within a page. Make it true
to crawl links matching the url
signature.