At ProtonDatalabs, we leverage cutting-age gen-AI solutions to deliver buisness value to our clients. We are able to do this by combining aspects from AI modelling to full-stack developement.
In this assignment, your task is to build a chatbot application which takes a file as an input and answers user's query. The goal of this application is to accurately provide answers based on the uploaded file. This application could be used as an assistant to quickly answer questions or summarize facts from files containing large amounts of text data, making our lives easier.
In this project you find 2 directories
backend
containing the server side python codefrontend
containing the client side typescript code.
In both these directories, it is your job to complete the missing modules and add necessary functionalities to make the app fully functional.
Requirements: Python 3.10 or above. We will test your submission against Python 3.10.
main.py
which is the entry point to our server- This project has a few Python packages as dependencies, you can install them in your virtual environment using
requirements.txt
. If you were to use other dependencies, then please add them torequirements.txt
. - We will be using
conda
package manager to create a virtual environmentchatbot
usingconda create -n chatbot python=3.10
and thenconda activate chatbot
to activate the environment. - Then install the python packages using
pip install -r requirements.txt
To launch the server, navigate to the backend
directory and run:
This will start the server at http://127.0.0.1:8000/
The project structure within the frontend
directory follows the official create-react-app
structure as in the docs. Some of the files have been removed for convenience & brevity.
Requirements: We are using node V20.11.1
and npm 10.2.4
. They can be downloaded via installer. For more information check here
-
Navigate to the
frontend
directory and runnpm install
-
Then you can run:
This will launch the app in development mode.
Open http://localhost:3000 to view it in the browser.
The page will reload if you make edits. You will also see any lint errors in the console.
- Currently, the server returns
hello world!
everytime user makes a query, which needs to be changed. Modify the/predict
endpoint to acheive this. You are free to use any architecture here: API based or open-source LLMs. The end goal in either case is to have a meaningful result based on the user query and uploaded file. - Implement the storage and handling of the incoming files from the frontend. You can use any database management system like MongoDB or MySQL for this.
- Add a pop up which notifies that the file has been uploaded properly.
- Extend the app's functionality to accept
.txt
,.docx
&.pdf
files in addition to.csv
files. - Add some styling to the bare bones app structure. You are free to use any popular CSS frameworks like Tailwind or UI libraries like Material or Chakra UI. Bonus points for creative and innovative designs.
- We expect that the app behaves similar to real world applications we interact with everyday. So think from the point of view of a user and handle all the possible edge cases which may occur while running the app. For instance, you can think of cases when the user has uploaded a very large file (>100mb) or a unsupported file type like video/mp3.
- Important We want you to uphold your best programming practices (SOLID, OOPs, type hints) for the completion of this assignment, as if your code would end up in production and interact with other software components. A robust solution which covers fewer points will be judged more favourably than a complete solution that cuts corners.
- We will check your assignment by doing a full run of your app with all possible edge cases and see how the results look. Please ensure the program is in a finished state so that we can execute even though you might not have completed it in full.
- Finally, be sure to provide a
README
document detailing your approach to completing the assignment, including the decisions you took and the reasons behind them.