This guide will help you set up the Audio Transcription Tool for local development.
- Python 3.8+: Download Python
- Git: Download Git
- OpenAI API Key: Get API Key
- UV Package Manager: Install UV (recommended)
- VS Code: Download VS Code with Python extension
- Terminal/Command Prompt: For running commands
git clone git@github.com:tomdwipo/agent.git
cd agent# Install UV if not already installed
curl -LsSf https://astral.sh/uv/install.sh | sh
# Create and activate virtual environment
uv venv
source .venv/bin/activate # On Windows: .venv\Scripts\activate
# Install dependencies
uv sync# Create virtual environment
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
# Upgrade pip
pip install --upgrade pip
# Install dependencies
pip install -r requirements.txt# Copy example environment file
cp .env.example .env
# Edit the .env file with your settingsEdit .env file with your settings:
# Required for AI features
OPENAI_API_KEY=sk-your-openai-api-key-here
# Optional configurations
WHISPER_MODEL=base
OPENAI_MODEL=gpt-4
MAX_FILE_SIZE_MB=500
GRADIO_SERVER_PORT=7860
GRADIO_DEBUG=true
# Feature toggles
ENABLE_KEY_POINTS=true
ENABLE_PRD_GENERATION=true
# PRD Configuration
PRD_OPENAI_MODEL=gpt-4
PRD_MAX_TOKENS=2000
PRD_TEMPERATURE=0.3# Verify Python version
python --version
# Verify packages are installed
pip list | grep -E "(gradio|openai|whisper)"# Run configuration demo
python -m demos config
# Or run directly
python demos/config_demo.py# Run services demo
python -m demos services
# Test individual services
python demos/services_demo.py# Run the main application
python transcribe_gradio.py
# Or use UV
uv run transcribe_gradio.pyOpen your browser and navigate to:
- Local: http://localhost:7860
- Network: http://0.0.0.0:7860 (if configured)
-
Install Extensions:
- Python
- Python Docstring Generator
- GitLens
- Pylance
-
Configure Settings (
.vscode/settings.json):
{
"python.defaultInterpreterPath": ".venv/bin/python",
"python.linting.enabled": true,
"python.linting.pylintEnabled": true,
"python.formatting.provider": "black",
"python.sortImports.args": ["--profile", "black"],
"editor.formatOnSave": true
}- Configure Launch (
.vscode/launch.json):
{
"version": "0.2.0",
"configurations": [
{
"name": "Python: Current File",
"type": "python",
"request": "launch",
"program": "${file}",
"console": "integratedTerminal"
},
{
"name": "Run Main App",
"type": "python",
"request": "launch",
"program": "${workspaceFolder}/transcribe_gradio.py",
"console": "integratedTerminal"
}
]
}# Using UV
uv add --dev black pylint pytest pytest-cov
# Using pip
pip install black pylint pytest pytest-cov# Format code with Black
black .
# Check code style
pylint services/ ui/ config/audio-transcription-tool/
├── transcribe_gradio.py # Main application entry point
├── requirements.txt # Python dependencies
├── pyproject.toml # Project configuration
├── .env # Environment variables
│
├── services/ # Business logic services
│ ├── whisper_service.py # Audio transcription
│ ├── openai_service.py # AI analysis and PRD generation
│ └── file_service.py # File operations
│
├── config/ # Configuration management
│ ├── settings.py # Environment settings
│ └── constants.py # Application constants
│
├── ui/ # User interface components
│ ├── components.py # Reusable UI components
│ └── gradio_interface.py # Interface implementations
│
├── demos/ # Demo scripts and examples
├── tests/ # Test suite
└── docs/ # Documentation
# Run all tests
python -m pytest
# Run with coverage
python -m pytest --cov=services --cov=ui --cov=config
# Run specific test file
python -m pytest tests/test_prd_services.py# List available demos
python -m demos list
# Run all demos
python -m demos all
# Run specific demo
python -m demos services
python -m demos ui
python -m demos config# Format code
black .
# Check linting
pylint services/ ui/ config/
# Type checking (if using mypy)
mypy services/ ui/ config/# Add runtime dependency
uv add package-name
# Add development dependency
uv add --dev package-name
# Update dependencies
uv sync# Install and add to requirements
pip install package-name
pip freeze > requirements.txtENVIRONMENT=development
GRADIO_DEBUG=true
LOG_LEVEL=DEBUG
ENABLE_LOGGING=trueENVIRONMENT=production
GRADIO_DEBUG=false
GRADIO_SHARE=false
LOG_LEVEL=INFOENVIRONMENT=testing
WHISPER_MODEL=tiny
MAX_FILE_SIZE_MB=10Problem: ModuleNotFoundError when importing services
Solution:
# Ensure you're in the project root
pwd
# Activate virtual environment
source .venv/bin/activate # or venv/bin/activate
# Reinstall dependencies
uv sync # or pip install -r requirements.txtProblem: OpenAI features not working Solution:
# Check API key configuration
python -c "from config.settings import settings; print(settings.is_openai_configured())"
# Test API connection
python demos/services_demo.pyProblem: Port 7860 already in use Solution:
# Use different port
GRADIO_SERVER_PORT=8080 python transcribe_gradio.py
# Or kill existing process
lsof -ti:7860 | xargs kill -9Problem: Audio files not processing Solution:
# Check supported formats
python -c "from config.constants import SUPPORTED_AUDIO_FORMATS; print(SUPPORTED_AUDIO_FORMATS)"
# Test with small file
python demos/services_demo.py-
Check Configuration:
python demos/config_demo.py
-
Run Diagnostics:
python demos/test_runner.py
-
Check Logs: Look for error messages in the terminal output
-
Review Documentation: Check the API documentation for detailed usage
-
Start Development Session:
cd /path/to/project source .venv/bin/activate git pull origin main
-
Make Changes: Edit code, add features, fix bugs
-
Test Changes:
python -m pytest python demos/test_runner.py
-
Format and Lint:
black . pylint services/ ui/ config/ -
Commit Changes:
git add . git commit -m "Description of changes" git push origin feature-branch
-
Create Feature Branch:
git checkout -b feature/new-feature
-
Implement Feature: Follow the architecture patterns
-
Add Tests: Write tests for new functionality
-
Update Documentation: Update relevant docs
-
Create Pull Request: Submit for review
After completing setup:
- Explore the Codebase: Review the Architecture Documentation
- Run Demo Scripts: Understand how components work
- Read API Documentation: Learn the Services API
- Check Contributing Guidelines: Review Contributing Guide
- Start Development: Begin with small changes or bug fixes
- Architecture Documentation: Technical architecture details
- API Reference: Complete API documentation
- Feature Documentation: Feature specifications
- Main README: Project overview and usage
Setup Guide Version: 1.0.0
Last Updated: January 2025
Maintainer: Development Team