An incredibly professional, modern, and production-ready Sales Call Quality Assurance (QA) Dashboard built with Streamlit. Designed specifically for auditing and coaching sales departments under Engosoft's strict quality rules, featuring a complete Right-to-Left (RTL) layout, Google Font 'Tajawal' typography, isolated call session histories, and a dedicated AI Coaching chatbot for each call.
Developed for seamless deployment to the Streamlit Community Cloud and optimized for GitHub version control.
-
Session & History Management (Sidebar)
- Powered by
st.session_stateto handle multiple distinct call audit sessions. - ➕ مكالمة جديدة (New Chat) button to immediately reset the UI and analyze a new call transcript or upload an audio recording.
- Interactive Call History List featuring visual status emojis (🟢 for final score >= 80%, 🔴 for final score < 80%) along with timestamps.
- Clicking any historical entry swaps the main screen context to display its specific scorecard evaluation metrics and isolated coaching chatbot history.
- Powered by
-
Strict QA Scorecard Compliance (Arabic Only)
- Renders quality audits strictly conforming to the predefined Arabic QA matrix format:
🎧 نص المكالمة: Speaker-tagged dialogue translated to formal sales Arabic.📌 نوع المكالمة: Fresh Lead or Follow-up categorization.📊 ملخص السكور: Percentage final score and Auto-Fail indicator.❌ الأخطاء: Bulleted list detailing compliance infractions and point deductions.📋 جدول التقييم: Structured markdown matrix detailing category, item, status (TRUE/FALSE), and score impact.🧠 ملاحظات الكواليتي (Coaching): Actionable feedback split into Strengths, Main Errors, and an Improvement Plan.🤖 تحليل ذكي: Buyer temperature type, buying signals, missed opportunities, and converting probability.
- Renders quality audits strictly conforming to the predefined Arabic QA matrix format:
-
Isolated Chatbot Per Call (AI Coaching Assistant)
- Positioned beneath each call's evaluation scorecard.
- Chat histories are isolated and saved per call (
st.session_state.sessions[session_id]['chat_history']). - Acts as an AI Coaching Assistant to help auditors and sales managers practice objection handling, brainstorm alternative sales pitches, and generate high-converting scripts based on the call transcript.
- Smart offline mock responses trigger if no API key is supplied (e.g. providing real-world scripts for objections when asked for alternatives).
-
UI/UX & Arabic RTL Support
- Custom CSS injected using
unsafe_allow_html=Trueto enforce a gorgeous RTL (Right-to-Left) reading experience. - Professional Arabic font family Tajawal imported dynamically from Google Fonts.
- Curated navy/slate color palette with custom background styles for chat bubbles and score metric cards.
- Custom CSS injected using
-
API & Offline Safe Mode
- Runs in Demo / Mock Mode out-of-the-box using preloaded high and low scoring compliance audits.
- New transcripts pasted in Demo Mode are dynamically audited using local regex/keyword matrices to output realistic evaluations.
- Paste a
GEMINI_API_KEYinto the sidebar to activate the live Gemini 2.5 Flash reasoning engine.
Ensure you have Python 3.9 or higher installed on your computer.
-
Clone the Repository:
git clone <your-repository-url> cd <repository-directory>
-
Set Up Python Environment: It is recommended to run in a virtual environment:
python -m venv venv # On Windows: venv\Scripts\activate # On macOS/Linux: source venv/bin/activate
-
Install Dependencies: Install required Python packages:
pip install -r requirements.txt
-
Configure Environment Variables (Optional): Create a
.envfile in the root directory:GEMINI_API_KEY=your_actual_gemini_api_key_here
-
Run the Application: Start the Streamlit development server:
streamlit run app.py
Open your browser and navigate to
http://localhost:8501.
Streamlit Community Cloud is the best platform to host this application. Follow these instructions:
-
Push Code to GitHub: Ensure all files (
app.py,requirements.txt,packages.txt,.gitignore) are committed and pushed to your public or private GitHub repository. -
Sign In to Streamlit Community Cloud: Go to share.streamlit.io and log in with your GitHub account.
-
Deploy a New App:
- Click the "New app" button.
- Select your Repository, Branch (e.g.,
main), and set the Main file path toapp.py. - Click "Deploy!".
-
Configure Environment Secrets (For Gemini Integration):
- Once the application is deployed, click on the "Settings" icon in the bottom-right corner of the Streamlit dashboard screen.
- In the settings pop-up, navigate to the "Secrets" tab.
- Enter your API Key in TOML format:
GEMINI_API_KEY = "your_actual_gemini_api_key_here"
- Click "Save". Streamlit will automatically restart your app with the secret active.
├── app.py # Main dashboard application code (RTL styling, session flow, schemas)
├── main.py # Console testing runner (Pydantic schema definitions, system instructions)
├── requirements.txt # Python dependencies for Streamlit Cloud deployment
├── packages.txt # Linux compilers required on Streamlit server
├── .env # Environment secrets configuration (Excluded from git)
└── README.md # Professional project documentation