diff --git a/.dev_session/SESSION_INFO b/.dev_session/SESSION_INFO index 2176c22b..0af11432 100644 --- a/.dev_session/SESSION_INFO +++ b/.dev_session/SESSION_INFO @@ -1 +1 @@ -{"task_id": "2f988f42-8544-8100-9dba-e69ee2376730", "token": "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", "session_start_time": "2026-01-31T05:48:55.785384"} \ No newline at end of file +{"task_id": "2f988f42-8544-81bc-97b2-ccd361f116a4", "token": "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", "session_start_time": "2026-01-31T08:29:52.360032"} \ No newline at end of file diff --git a/dashboard/index.html b/dashboard/index.html index da169827..135e6033 100644 --- a/dashboard/index.html +++ b/dashboard/index.html @@ -190,7 +190,7 @@
Transkribieren Sie Meetings (MP3/WAV) mit automatischer Sprechererkennung und Timestamps via Gemini 2.0.
- Starten → + Starten → diff --git a/debug_meeting.py b/debug_meeting.py new file mode 100644 index 00000000..5abb5db2 --- /dev/null +++ b/debug_meeting.py @@ -0,0 +1,71 @@ + +import sqlite3 +import json +import os + +DB_PATH = "transcription-tool/backend/meetings.db" +MEETING_ID = 5 + +def debug_meeting(db_path, meeting_id): + if not os.path.exists(db_path): + print(f"ERROR: Database file not found at {db_path}") + return + + try: + conn = sqlite3.connect(db_path) + cursor = conn.cursor() + + # Get Meeting Info + cursor.execute("SELECT id, title, status, duration_seconds FROM meetings WHERE id = ?", (meeting_id,)) + meeting = cursor.fetchone() + + if not meeting: + print(f"ERROR: No meeting found with ID {meeting_id}") + return + + print("--- MEETING INFO ---") + print(f"ID: {meeting[0]}") + print(f"Title: {meeting[1]}") + print(f"Status: {meeting[2]}") + print(f"Duration (s): {meeting[3]}") + print("-" * 20) + + # Get Chunks + cursor.execute("SELECT id, chunk_index, json_content FROM transcript_chunks WHERE meeting_id = ? ORDER BY chunk_index", (meeting_id,)) + chunks = cursor.fetchall() + + print(f"--- CHUNKS FOUND: {len(chunks)} ---") + for chunk in chunks: + chunk_id, chunk_index, json_content_str = chunk + print(f"\n--- Chunk ID: {chunk_id}, Index: {chunk_index} ---") + + if not json_content_str: + print(" -> JSON content is EMPTY.") + continue + + try: + json_content = json.loads(json_content_str) + print(f" -> Number of entries: {len(json_content)}") + + if json_content: + # Print first 2 and last 2 entries to check for the "Ja" loop + print(" -> First 2 entries:") + for entry in json_content[:2]: + print(f" - {entry.get('display_time')} [{entry.get('speaker')}]: {entry.get('text')[:80]}...") + + if len(json_content) > 4: + print(" -> Last 2 entries:") + for entry in json_content[-2:]: + print(f" - {entry.get('display_time')} [{entry.get('speaker')}]: {entry.get('text')[:80]}...") + + except json.JSONDecodeError: + print(" -> ERROR: Failed to decode JSON content.") + + except sqlite3.Error as e: + print(f"Database error: {e}") + finally: + if 'conn' in locals() and conn: + conn.close() + +if __name__ == "__main__": + debug_meeting(DB_PATH, MEETING_ID) diff --git a/transcription-tool/backend/services/llm_service.py b/transcription-tool/backend/services/llm_service.py index 8e9c9ad0..a311d9be 100644 --- a/transcription-tool/backend/services/llm_service.py +++ b/transcription-tool/backend/services/llm_service.py @@ -27,8 +27,9 @@ def call_gemini_api(prompt: str, temperature: float = 0.7, retries: int = 3, tim logging.error("GEMINI_API_KEY environment variable not set.") raise ValueError("API key not found.") - # Fallback to v1 (stable) and gemini-pro - url = f"https://generativelanguage.googleapis.com/v1/models/gemini-pro:generateContent?key={api_key}" + # As per documentation, use the established v1beta endpoint and gemini-2.0-flash model + model_name = "gemini-2.0-flash" + url = f"https://generativelanguage.googleapis.com/v1beta/models/{model_name}:generateContent?key={api_key}" headers = {'Content-Type': 'application/json'} payload = { "contents": [{