An open API service indexing awesome lists of open source software.

https://github.com/bm9avan/hcbot

This is an Hitesh Choudhary ai persona but this is created to help users with queries about the 'Chai Docs' documentation
https://github.com/bm9avan/hcbot

aipersona gemini-ai python streamlit

Last synced: about 1 month ago
JSON representation

This is an Hitesh Choudhary ai persona but this is created to help users with queries about the 'Chai Docs' documentation

Awesome Lists containing this project

README

          

# ๐Ÿ’ฌ CHAI DOCS โ€” Gemini 2.5 Chatbot (by bm9avan)

An elegant chatbot interface powered by Google's Gemini 2.5 Flash model, built using Streamlit. This project includes custom persona injection via a system prompt, real-time chat memory, and an auto-scrolling UI with a sidebar for persona visibility.

---

## ๐Ÿš€ Features

- โœจ Gemini 2.5 Flash model integration using `google.genai`
- ๐Ÿง  Persona Prompt loaded from JSON
- ๐ŸชŸ Sticky sidebar showing current system prompt
- ๐Ÿ’ฌ Conversation history with roles (user & assistant)
- โฌ‡๏ธ Input box pinned at the bottom for continuous chat flow
- ๐Ÿ”„ Auto-scrolls to the latest message automatically
- ๐Ÿงผ Clean layout with custom CSS for enhanced UX

---

## ๐Ÿ“ Project Structure

```

hcBot/
โ”œโ”€โ”€ main.py # Streamlit app logic
โ”œโ”€โ”€ Persona\_prompt.json # Contains the system persona instruction
โ”œโ”€โ”€ requirements.txt # Python dependencies
โ””โ”€โ”€ .streamlit/
โ””โ”€โ”€ secrets.toml # Gemini API key config

```

---

## ๐Ÿ›  Setup & Run

### 1. Clone the repo

```bash
git clone https://github.com/bm9avan/gemini-chatbot.git
cd gemini-chatbot
```

### 2. Create virtual environment

```bash
python3 -m venv .venv
source .venv/bin/activate # Linux/macOS
.venv\\Scripts\\activate # Windows
```

### 3. Install dependencies

```bash
pip install -r requirements.txt
```

### 4. Add your Gemini API key

Create a file at `.streamlit/secrets.toml` and add:

```toml
[genai]
api_key = "your-gemini-api-key-here"
```

### 5. Customize Persona Prompt

Edit `Persona_prompt.json`:

```json
{
"system_instruction": "You are a helpful, knowledgeable AI that speaks like a software engineer and explains concepts clearly using analogies."
}
```

---

## โ–ถ Run the App

```bash
streamlit run main.py
```

---

## โœ๏ธ Customization

- ๐Ÿ’ก Want to change the assistant tone? Just modify `Persona_prompt.json`.
- ๐Ÿ“œ Need markdown/code formatting? You can enhance output rendering using `st.markdown(..., unsafe_allow_html=True)` or with custom syntax highlighting.

---

## ๐Ÿ“„ License

MIT โ€” feel free to fork and remix.

---

## ๐Ÿ‘ค Author

Made by [bm9avan](https://github.com/bm9avan) with ๐Ÿ’™ using Streamlit + Gemini AI