Skip to content

Latest commit

Β 

History

History
163 lines (112 loc) Β· 3.67 KB

File metadata and controls

163 lines (112 loc) Β· 3.67 KB

🧠 MasterSpeakAI

MasterSpeakAI is a GenAI-powered speech analysis app with:

  • πŸŽ›οΈ A Streamlit frontend using st.navigation and st.Page
  • πŸ”₯ FastAPI backend
  • πŸ§ͺ GPT-powered analysis (via OpenAI)
  • πŸ’Ύ Local SQLite databases for storing analyses, prompt presets, and model settings
  • βš™οΈ Model-specific configuration (e.g., temperature, max_tokens)
  • πŸ“¦ Managed with Poetry

πŸš€ Features

  • πŸŽ™οΈ Analyze speech content using OpenAI GPT models (3.5, 4, 4o, etc.)
  • 🧠 Create and edit reusable system prompt presets
  • βš™οΈ Configure model settings (e.g., temperature) per model
  • πŸ’Ύ View and retrieve records using compact scrollable DB viewers
  • πŸ“Ž Manual ID lookup for speech/prompt/model records
  • 🧩 Grouped sidebar navigation for logical app structure

πŸ“ Project Structure


kaiser-data-masterspeakai\_streamlit/
β”œβ”€β”€ backend/
β”‚   β”œβ”€β”€ database.py              # SQLModel tables for speech, prompts, models
β”‚   β”œβ”€β”€ main.py                  # FastAPI app with /analyze endpoint
β”‚   β”œβ”€β”€ init\_db.py               # Creates all DB tables
β”œβ”€β”€ frontend/
β”‚   β”œβ”€β”€ app.py                   # Main entrypoint with st.navigation sidebar
β”‚   └── pages/
β”‚       β”œβ”€β”€ 0\_Home.py
β”‚       β”œβ”€β”€ 1\_Speech\_Analysis.py
β”‚       β”œβ”€β”€ 2\_Database\_Viewer.py         # Speech DB (manual ID lookup)
β”‚       β”œβ”€β”€ 3\_Prompt\_Settings.py         # Create/edit prompts
β”‚       β”œβ”€β”€ 4\_Prompt\_Viewer.py           # Prompt DB (manual ID lookup)
β”‚       β”œβ”€β”€ 5\_Model\_Settings.py          # Edit model config
β”‚       └── 6\_Model\_Settings\_Viewer.py   # View saved configs
β”œβ”€β”€ init\_db.py                  # Calls backend.init\_db functions
β”œβ”€β”€ pyproject.toml              # Poetry config
β”œβ”€β”€ requirements.txt            # pip fallback
β”œβ”€β”€ speech\_db.db
β”œβ”€β”€ prompt\_db.db
β”œβ”€β”€ model\_settings.db
└── .env                        # For OPENAI\_API\_KEY


🧭 Sidebar Navigation

Organized using st.navigation() with icons and sections:

  • 🧠 MasterSpeakAI

    • 🏠 Home
  • πŸ”Š Speech Analysis

    • πŸŽ™οΈ Analyze Speech
    • πŸ’Ύ Speech DB Viewer (with manual ID input)
  • πŸ› οΈ Prompt Settings

    • πŸ› οΈ Prompt Editor
    • πŸ“œ Prompt DB Viewer (with manual ID input)
  • βš™οΈ Model Settings

    • 🧩 Edit Model Settings (temperature, top_p, etc.)
    • πŸ—ƒοΈ Model DB Viewer

πŸ“¦ Dependency Management with Poetry

This project uses Poetry to manage dependencies and virtual environments.

πŸ“₯ Install Poetry

curl -sSL https://install.python-poetry.org | python3 -

Ensure it's on your PATH:

export PATH="$HOME/.local/bin:$PATH"

πŸ“¦ Install Dependencies

git clone https://github.com/your-org/kaiser-data-masterspeakai_streamlit.git
cd kaiser-data-masterspeakai_streamlit
poetry install

🐍 Run the App

poetry run streamlit run frontend/app.py

πŸ”§ Initialize the Databases

poetry run python init_db.py

Creates:

  • speech_db.db
  • prompt_db.db
  • model_settings.db

πŸ§ͺ Run Backend API

poetry run uvicorn backend.main:app --reload

Visit the docs at: http://localhost:8000/docs


πŸ” Environment Variables

Create a .env file with your OpenAI key:

OPENAI_API_KEY=your-key-here

πŸ—‚οΈ Future Improvements

  • ⏳ User authentication
  • ⏳ Role-based prompt/model visibility
  • ⏳ Speech-to-text input support
  • ⏳ Export results to CSV
  • ⏳ Admin edit/delete for DB records

πŸͺͺ License

MIT License.