WebQA project allows you to ask any question on the contents of the webpage using LangChain, OpenAI Embeddings and gpt-3.5-turbo. The project consist of
- WebQA-Extension (Chrome Extension)
- WebQA-API (Python Flask API)
WebQA-API offers a cutting-edge question-answer endpoint for webpages. It processes incoming JSON post requests containing webpage data and user questions. The API initially starts by chunking down the webpage data and requesting embeddings from OpenAI. The obtained embeddings and chunked webpage documents are then temporarily stored in Chroma embedding DB.
The API also obtains the question's embedding and employs embedding nearest search to find relevant documents. A specialized prompt is then crafted using the obtained documents and user questions, and it's sent to OpenAI API via LangChain. Once OpenAI API responds, the WebQA-API forwards the response to form an accurate response to the user.
Use the package manager pip to install WebQA-API.
pip install -r requirements.txt
WebQA-API requires OpenAI API key to be configured in the src/config.py
file.
OPENAI_API_KEY = "YOUR_API_KEY"
WebQA-API can be run locally using the following command.
python app.py
WebQA-API offers the /question-answer
endpoint that takens in json POST request in the following format.
{
"webpage": "CONTENT OF THE WEBPAGE",
"question": "QUESTION TO BE ASKED"
}
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.