This project is a simple Generative Assistant application built with Streamlit that allows users to upload images or enter text prompts to receive AI-generated summaries or responses. The app uses Google’s generative AI model, configured via the google-generativeai Python package, to process and respond to user inputs.
- Text Prompt Responses: Enter any text prompt, and the model generates an AI-powered response.
- Document Interaction: Upload an image/doc along with a prompt, and the app provides a summarized response.
- Interactive UI: A simple and user-friendly interface for uploading files and receiving outputs.
- Python 3.10+
- Google Generative AI API Key
-
Clone the Repository:
git clone https://github.com/Chayan-03/Build_with_AI.git cd generative-assistant
-
Install Dependencies:
Ensure you have pip installed, then run:
pip install -r requirements.txt pip install -U google-generativeai
-
Set Up Environment Variables:
-
Create a
.env
file in the root directory. -
Add your Google Generative AI API key:
API_KEY=your_google_genai_api_key
-
-
Run the Application:
Start the Streamlit app with the following command:
streamlit run app.py
Replace
app.py
with the actual file name of the main script if it differs. -
Access the Application:
Open a web browser and go to
http://localhost:<port_number>
to interact with the app.
Instead of manually installing dependencies, you can use Docker to run the application. The prebuilt image is available on Docker Hub.
- Pull the Docker Image from Docker Hub
docker chayan03/generative-assistant:latest
- Run the Docker Container by providing your Gemini API key as -
Now, open your browser and go to http://localhost:8501 to access the app.
docker run -p 8501:8501 -e API_KEY="your_google_api_key" your_dockerhub_username/generative-assistant
-
Text Prompts:
- Enter a question or prompt in the text area and click Submit. The app will display an AI-generated response.
-
Doc Summarization:
- Upload an image/doc and enter a related prompt, then click Submit. The app will provide a summary based on the content of the image and prompt.
- Streamlit - For creating a user-friendly web interface
- google-generativeai - To interact with Google Generative AI
- Python Dotenv - For environment variable management
- Google Generative AI for providing the generative model.
- Streamlit for the framework to build this simple UI.