From cbc372608f0a5bac94ad9d76777f91de82c6ef14 Mon Sep 17 00:00:00 2001 From: Floke Date: Tue, 1 Jul 2025 07:07:11 +0000 Subject: [PATCH] bugfix --- helpers.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/helpers.py b/helpers.py index 045fe407..80f6aa82 100644 --- a/helpers.py +++ b/helpers.py @@ -1008,11 +1008,11 @@ for line in lines: if result["justification"]: result["justification"] += " " + justification_text else: result["justification"] = justification_text - if not parsed_branch or not suggested_branch or suggested_branch.lower() in ["k.a.", "n/a"]: - logger.error(f"Fehler in evaluate_branche_chatgpt: Konnte 'Branche:' nicht oder nur leer/k.A. aus Antwort parsen: {chat_response[:500]}...") - crm_short_branch_for_fallback = "k.A." - if crm_branche and isinstance(crm_branche, str) and crm_branche.strip().lower() != "k.a.": - crm_short_branch_for_fallback = crm_branche.strip() + if not parsed_branch or not suggested_branch or suggested_branch.lower() in ["k.a.", "n/a"]: + logger.error(f"Fehler in evaluate_branche_chatgpt: Konnte 'Branche:' nicht oder nur leer/k.A. aus Antwort parsen: {chat_response[:500]}...") + crm_short_branch_for_fallback = "k.A." + if crm_branche and isinstance(crm_branche, str) and crm_branche.strip().lower() != "k.a.": + crm_short_branch_for_fallback = crm_branche.strip() return { "branch": crm_short_branch_for_fallback if crm_short_branch_for_fallback.lower() != "k.a." else "FEHLER PARSING",