This is the Back-end repo for the LLM API in the Advanced-RAG project encorporating feedback from the user
pip install -r requirements.txt
python main.py
We convert our database schema into vector embeddings to match user queries with the respective tables. We have also incorporated a feedback-loop where user can give feedback on the selected tables and correct them.
To get the related tables to a user query
curl -X POST \
http://localhost:5000/tables \
-H "Content-Type: application/json" \
-d '{"inputText": "how many clients are there?"}'
To get the response based on the choosen tables by the user
curl -X POST \
http://localhost:5000/response \
-H "Content-Type: application/json" \
-d '{"inputText": "how many clients are there?", "choosen_tables": ["table1", "table2"]}'
The choosing of the tables is handled by the front-end logic
By default, it will use OpenAI for both embeddings and inference. You can change the models_config
object to change the models for embeddings and inference accordingly
models_config = {
"llm": "gemini",
"embeddings": "ollama"
}
This code creates the APIs to interact with our choice of LLM service. These APIs then interacts with NodeJS which acts as an interface between oue front-end and the LLM APIs.