/Synthia

Primary LanguagePythonMIT LicenseMIT

Synthia

Synthia is a Streamlit-based AI application that allows users to upload PDFs and interact with the document’s content through natural language queries. The assistant provides answers via video responses from customizable avatars powered by HeyGen API.


🌟 Features

πŸ“„ PDF Viewer: Upload and view PDF documents within the app.

🧠 AI-Powered Chat: Ask questions about the content of the uploaded PDF and receive relevant answers.

πŸŽ₯ Avatar Video Responses: Choose from a variety of avatars to deliver answers in a video format using HeyGen.

βš™οΈ Session Management: Manage video streaming sessions seamlessly (create, start, and close sessions).

πŸ”Ž Semantic Search: Retrieve relevant document chunks to generate accurate answers.


πŸ› οΈ Demo

Synthia Demo


πŸŽ₯ UI in Action

πŸ“„ Upload a PDF

Landing Page

πŸ€– Select an Avatar

πŸ–ΌοΈ Avatar Options

You can select one of the following Avatars for this demo.

Avatar Name Role Description
Judy Teacher Formal and professional avatar
Bryan Fitness Coach Energetic and engaging avatar
Silas Customer Support Helpful and friendly avatar
Judy_Teacher_Sitting_public.mp4
Bryan_FitnessCoach_public.mp4
Silas_CustomerSupport_public.mp4

πŸŽ₯ Create and Start a Video Session

Create_Start_Video_Session.mp4

Ask a Question and Get a Video Response

Question_Response.mp4

πŸš€ Getting Started

1️⃣ Installation

  1. Clone this repository:

    git clone git@github.com:anujdutt9/Synthia.git
    cd Synthia
  2. Create a virtual environment and activate it:

    python3 -m venv venv
    source venv/bin/activate
  3. Install the required dependencies:

    pip install -r requirements.txt

2️⃣ Setup Environment Variables

Create a .env file in the root directory with the following content:

# HeyGen API Settings
HEYGEN_API_KEY=<your_heygen_api_key>
HEYGEN_SERVER_URL=<your_heygen_server_url>
OPENAI_API_KEY=<your_openai_api_key>

3️⃣ Run the Application

  1. Launch the Streamlit app:
streamlit run app.py
  1. Access the app in your browser: Navigate to the local URL provided in the terminal (e.g., http://localhost:8501).

  2. Upload a PDF, select an avatar, and start interacting with Synthia!


πŸ” How It Works

  1. PDF Upload: Users upload a PDF file, which is processed to extract text and create vector embeddings.
  2. Text Chunking & Retrieval: The document content is split into chunks, and the most relevant chunks are retrieved based on user queries.
  3. Avatar Video Responses: The HeyGen API is used to create and manage video sessions where avatars deliver AI-generated responses.

πŸ› οΈ Troubleshooting

Issue Solution
Missing API Keys Ensure the HEYGEN_API_KEY is correctly set in the .env file.
Video Not Loading Verify the HeyGen server URL and API key.
PDF Processing Error Ensure the uploaded file is a valid PDF and not empty.

🀝 Contribution

Contributions are welcome! Please fork this repository, create a new branch for your feature or bug fix, and submit a pull request. For major changes, please open an issue to discuss them first.


πŸ“œ License

This project is licensed under the MIT License. See the LICENSE file for more details.