This commit is contained in:
2025-07-01 07:11:25 +00:00
parent 0291655963
commit 6bdaff76a4

View File

@@ -894,6 +894,7 @@ def summarize_batch_openai(tasks_data):
# 9. OPENAI API WRAPPER (BRANCH EVALUATION)
# ==============================================================================
@retry_on_failure
@retry_on_failure
def evaluate_branche_chatgpt(crm_branche, beschreibung, wiki_branche, wiki_kategorien, website_summary):
"""
@@ -904,10 +905,10 @@ def evaluate_branche_chatgpt(crm_branche, beschreibung, wiki_branche, wiki_kateg
from config import TARGET_SCHEMA_STRING, FOCUS_BRANCHES_PROMPT_PART, ALLOWED_TARGET_BRANCHES
# NEU: Lazy Loading des Branchenschemas
# Lazy Loading des Branchenschemas
if not ALLOWED_TARGET_BRANCHES:
logger.warning("Branchenschema nicht geladen. Versuche es jetzt zu laden...")
if not initialize_target_schema(): # <<< HIER GEÄNDERT
if not initialize_target_schema():
logger.critical("FEHLER in evaluate_branche_chatgpt: Ziel-Branchenschema konnte auch bei Bedarf nicht geladen werden. Breche Evaluation ab.")
return {
"branch": "FEHLER - SCHEMA FEHLT",
@@ -983,7 +984,7 @@ def evaluate_branche_chatgpt(crm_branche, beschreibung, wiki_branche, wiki_kateg
parsed_branch = False
parsed_confidence = False
for line in lines:
for line in lines:
line_stripped = line.strip()
line_lower = line_stripped.lower() # WICHTIG: Variable wieder einführen