This application allows users to upload .txt
and .pdf
documents and ask questions about their content using a conversational AI interface. It efficiently handles large documents by chunking them into smaller pieces and retrieves contextually relevant information to answer user queries.
-
π File Upload Functionality for
.txt
and.pdf
Files
Users can upload.txt
and.pdf
files for processing and analysis. -
π¬ Conversational Interface with Document Content
A chat interface that allows users to ask questions about the uploaded documents and receive relevant, context-aware responses. -
π Support for Multiple Documents
Upload and interact with multiple documents simultaneously, with separate handling of each document's content. -
π Efficient Document Chunking
Automatically breaks large documents into manageable chunks for faster processing and improved retrieval accuracy. -
π Intelligent Information Retrieval
Fetches accurate answers based on the specific context of the uploaded files usingLangChain
,Chroma
, andAzureOpenAIEmbeddings
.
- Docker
- Docker Compose
- Visual Studio Code with the Remote - Containers extension
- OpenAI API Key (for GPT-based querying)
Clone the repository to your local machine:
git clone https://github.com/shar-sun/A1.git
cd A1
- Open VS Code and navigate to the
A1
folder.
Create a .env
file in the project folder with the following content:
OPENAI_API_KEY=your-api-key-here
OPENAI_BASE_URL=your-api-base-url-here
TZ=your-timezone-here
- Open the Command Palette:
- Press
Ctrl+Shift+P
on Windows/Linux orCmd+Shift+P
on macOS.
- Press
- Search for:
Remote-Containers: Reopen in Container
and select it. - VS Code will build and open the project inside the Docker container automatically.
Open a terminal in Visual Studio Code and run the following command:
streamlit run chat_with_pdf.py
- Open the URL provided by Streamlit in your browser (usually
http://localhost:8501
). - Upload
.txt
and.pdf
files using the provided interface. - Interact with the chatbot by asking questions related to the content of the uploaded documents.
- Ensure Docker and Docker Compose are installed and running on your machine.
- The
.env
file must contain valid OpenAI API credentials for the application to function correctly. - Make sure that the Remote - Containers extension in VSCode is properly configured.