fix(transcription): Behebt Start- und API-Fehler in der App [2f488f42]

This commit is contained in:
2026-01-26 14:15:23 +00:00
parent eb3f77f092
commit e57aa374ea
10 changed files with 427 additions and 162 deletions

View File

@@ -121,6 +121,28 @@ def create_insight(meeting_id: int, payload: InsightRequest, db: Session = Depen
print(f"ERROR: Unexpected error in create_insight: {e}")
raise HTTPException(status_code=500, detail="An internal error occurred while generating the insight.")
class TranslationRequest(BaseModel):
target_language: str
@app.post("/api/meetings/{meeting_id}/translate")
def translate_meeting_transcript(meeting_id: int, payload: TranslationRequest, db: Session = Depends(get_db)):
"""
Triggers the translation of a meeting's transcript.
"""
try:
# For now, we only support English
if payload.target_language.lower() != 'english':
raise HTTPException(status_code=400, detail="Currently, only translation to English is supported.")
from .services.translation_service import translate_transcript
translation = translate_transcript(db, meeting_id, payload.target_language)
return translation
except ValueError as e:
raise HTTPException(status_code=400, detail=str(e))
except Exception as e:
print(f"ERROR: Unexpected error in translate_meeting_transcript: {e}")
raise HTTPException(status_code=500, detail="An internal error occurred during translation.")
class RenameRequest(BaseModel):
old_name: str
new_name: str