Viele Änderungen

This commit is contained in:
RubenRWU
2026-04-07 15:08:56 +02:00
parent b4e78206ed
commit d1866508ca
12 changed files with 1130 additions and 422 deletions

67
SPEC.md
View File

@@ -3,15 +3,16 @@
## Project Overview
- **Name**: Transcribe App
- **Type**: Web Application (FastAPI + Vanilla JS)
- **Core Functionality**: Voice recording/transcription with AI processing and email delivery
- **Core Functionality**: Voice recording/transcription with AI-based protocol generation and email delivery
- **Target Users**: Users who need to transcribe voice notes and receive processed text via email
## Tech Stack
- **Backend**: FastAPI (Python)
- **Speech-to-Text**: OpenAI Whisper API
- **AI Processing**: OpenAI GPT-4o
- **Speech-to-Text**: Azure AI Speech Fast Transcription API
- **Meeting-Protokoll**: Claude Sonnet 4.6 via Azure Foundry
- **Email**: SMTP with environment variables
- **Frontend**: Vanilla HTML/CSS/JS
- **Lokale Zwischenspeicherung im Browser**: IndexedDB für UI-State und lokale Audio-Datei bis zur Transkription
## UI/UX Specification
@@ -70,8 +71,8 @@
- Steps displayed vertically:
1. "Hochladen..." / "✓ Hochgeladen"
2. "Transkribieren..." / "✓ Transkribiert"
3. "KI-Verarbeitung..." / "✓ Verarbeitet"
4. "E-Mail senden..." / "✓ Gesendet"
3. "Review..." / "✓ Bereit"
4. "Protokoll senden..." / "✓ Gesendet"
- Each step with icon, timestamp
#### Send Button
@@ -84,43 +85,51 @@
### Core Features
#### 1. File Upload (Drag & Drop)
- Accept only .mp3 files
- Max file size: 25MB
- Show progress during upload
- Accept common audio formats (.mp3, .wav, .webm, .ogg, .flac)
- Max file size configurable via environment variable
- Validate file type before upload
- Keep audio local in the browser until the user starts transcription
#### 2. Voice Recording
- Use MediaRecorder API (browser)
- Record in webm/opus format (convert to mp3 on server)
- Record in webm/opus format (convert to wav on server for Azure Speech)
- Show recording duration timer
- Playback recorded audio before submission
#### 3. Transcription
- Use OpenAI Whisper API
- Use Azure AI Speech Fast Transcription API
- Support German language
- Return timestamped segments
- Use speaker diarization when Azure returns speaker-separated phrases
- Send audio directly in the `/transcribe` request and delete the temporary server file immediately after processing
#### 4. AI Processing
- Use OpenAI GPT-4o
- Improve transcription:
- Fix grammar and spelling
- Add proper punctuation
- Structure into paragraphs
- Maintain original meaning
#### 5. Email Delivery
- Send processed text via SMTP
- Include original and processed text
- Email format: plain text
#### 4. Meeting-Protokoll und Versand
- Generate the final meeting summary from `prompt.txt`
- Use Claude Sonnet 4.6 hosted in Azure Foundry
- Queue document generation and email delivery in the background
- Expose send-job status via API polling
- Send formatted HTML email via SMTP
- Attach full transcript as PDF
### API Endpoints
- `POST /upload` - Upload audio file
- `POST /transcribe` - Transcribe audio
- `POST /process` - AI process text
- `POST /send-email` - Send email
- `POST /transcribe` - Upload and transcribe audio in one request
- `POST /send` - Queue email send job
- `GET /send-status/{job_id}` - Poll send job status
### Environment Variables
- OPENAI_API_KEY
- AZURE_SPEECH_ENDPOINT
- AZURE_SPEECH_KEY
- AZURE_SPEECH_API_VERSION
- AZURE_SPEECH_DIARIZATION_ENABLED
- AZURE_SPEECH_MAX_SPEAKERS
- AZURE_SPEECH_PROFANITY_MODE
- AZURE_SPEECH_LLM_PROMPT
- AZURE_ANTHROPIC_BASE_URL
- AZURE_ANTHROPIC_API_KEY
- AZURE_ANTHROPIC_MODEL
- AZURE_ANTHROPIC_MAX_TOKENS
- AZURE_ANTHROPIC_TEMPERATURE
- MAX_FILE_SIZE_MB
- TEMP_DIR
- SMTP_HOST
- SMTP_PORT
- SMTP_USER
@@ -137,4 +146,4 @@
6. ✓ App shows step-by-step progress
7. ✓ Final email is sent with processed text
8. ✓ Clean black/white design throughout
9. ✓ Responsive on mobile devices
9. ✓ Responsive on mobile devices