fix: PDF-Crash bei Nicht-Flugtickets — _check_flight_plausibility gab leeren String statt Tuple

This commit is contained in:
root 2026-03-17 10:22:16 +07:00
parent 6f3b940674
commit f4b48aae69

View file

@ -469,7 +469,7 @@ async def handle_photo(update: Update, ctx: ContextTypes.DEFAULT_TYPE):
await update.message.reply_text(f"Fehler bei Bildanalyse: {e}")
def _check_flight_plausibility(text: str) -> str:
def _check_flight_plausibility(text: str) -> tuple[str, list]:
"""Prueft LLM-Antwort auf verdaechtige Layover-Zeiten zwischen Flugsegmenten.
Parst Datum/Uhrzeit-Paare aus der strukturierten Antwort und flaggt
@ -512,7 +512,7 @@ def _check_flight_plausibility(text: str) -> str:
current_seg = {}
if len(segments) < 2:
return ""
return "", []
warnings = []
year = 2026