Implement AgentDBQA Class to Enhance Code Structure and Reusability and Dockerized Project using FastAPI #26
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Title: Implement AgentDBQA Class to Enhance Code Structure and Reusability and Dockerized Project using FastAPI
Description:
This pull request introduces the AgentDBQA class, which streamlines code organization and improves reusability across the project, Dockerfile included and passing
The changes made in this pull request include:
Update of the README.md file to incorporate the latest changes, including sections on how to use the repo through Docker.
Creation of the AgentDBQA class, which consolidates previously separate functions into a cohesive class. The class consists of methods for loading Notion data, splitting documents, creating a vector store, loading a FAISS index, and loading a vector store.
Refactoring of existing code in the following files to use the new AgentDBQA class:
streamlit_example.py: Updated the Streamlit frontend to employ the AgentDBQA class for handling user input and generating responses.
ask_question.py: Modified the script to work seamlessly with the AgentDBQA class when querying the Notion database.
Development of a test suite for the AgentDBQA class using Python's unittest module. This test suite covers all methods within the AgentDBQA class and ensures their proper functioning.
I kept running into errors along the lines of issue of issue #1100, i did note your comment Fix Issue #1100 langchain-ai/langchain#1101 (comment) but since I didnt want to change much I included the changes to langcain's openai.py file in --> https://github.com/Bucanero06/notion-qa-model/blob/fea19537ab412b028a39b92bf4e7596d0c173898/fix-openai-langchain.py
The Dockerfile gets a copy of the fixed file's content onto the original openai.py. Let me know of any feedback or dependencies for the merge.
P.S. my first pull request ever so lay it on me