Skip to content

Dev-Toledo/Gemini-Streamlit-Chatbot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

💬 Interactive Chatbot with Google Gemini AI & Streamlit

A modern web application demonstrating the integration of Streamlit's chat interface with Google's powerful Large Language Model (LLM), Gemini Pro.

📋 Project Description

This project showcases a complete chatbot pipeline. It features a clean frontend built with Streamlit (st.chat_message, st.chat_input) that maintains persistent conversation history during the user session. The backend is integrated with the Google Gemini API (specifically gemini-1.5-flash or gemini-pro), which processes user prompts and generates real-time responses.

🖥️ User Interface

Below is an illustration of the chatbot interface running locally:

Chatbot Interface Screenshot


✨ Key Features

  • Native Streamlit UI: Uses Streamlit's new chat elements for a seamless user experience.
  • Powered by Gemini: Integrates with Google Generative AI for fast and capable language model responses.
  • Session Memory: Leverages st.session_state to store and display the full chat history during a single session.
  • Cross-Compatibility: Demonstrates adaptable code structures capable of switching between LLM providers (e.g., from OpenAI to Gemini).

🛠️ Tech Stack

  • Python 3.12+
  • Streamlit: For the web interface and frontend elements.
  • google-generativeai: Python library to interact with Google's Gemini API.

⚙️ Setup and Installation

1. Prerequisites

You will need a Google Gemini API key. You can obtain one for free (within limits) at Google AI Studio.

2. Set Up Virtual Environment (Recommended)

Navigate to your project folder in the terminal:

# Create a virtual environment
python -m venv venv

# Activate the environment (Mac/Linux)
source venv/bin/activate

# Activate the environment (Windows)
# venv\Scripts\activate

3. Install Dependencies

pip install streamlit google-generativeai

4. Configuration

Open main.py and replace "API_KEY" with your actual Google API key.

5. Running the Application

streamlit run main.py

A new tab will automatically open in your browser displaying the chatbot.


🎓 Credits

Developed as part of the Hashtag Programação course.

About

Interactive web-based chatbot application featuring a Streamlit frontend and powered by Google's Generative AI.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages