bugfix
This commit is contained in:
@@ -894,6 +894,7 @@ def summarize_batch_openai(tasks_data):
|
|||||||
# 9. OPENAI API WRAPPER (BRANCH EVALUATION)
|
# 9. OPENAI API WRAPPER (BRANCH EVALUATION)
|
||||||
# ==============================================================================
|
# ==============================================================================
|
||||||
|
|
||||||
|
@retry_on_failure
|
||||||
@retry_on_failure
|
@retry_on_failure
|
||||||
def evaluate_branche_chatgpt(crm_branche, beschreibung, wiki_branche, wiki_kategorien, website_summary):
|
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
|
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:
|
if not ALLOWED_TARGET_BRANCHES:
|
||||||
logger.warning("Branchenschema nicht geladen. Versuche es jetzt zu laden...")
|
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.")
|
logger.critical("FEHLER in evaluate_branche_chatgpt: Ziel-Branchenschema konnte auch bei Bedarf nicht geladen werden. Breche Evaluation ab.")
|
||||||
return {
|
return {
|
||||||
"branch": "FEHLER - SCHEMA FEHLT",
|
"branch": "FEHLER - SCHEMA FEHLT",
|
||||||
@@ -983,7 +984,7 @@ def evaluate_branche_chatgpt(crm_branche, beschreibung, wiki_branche, wiki_kateg
|
|||||||
parsed_branch = False
|
parsed_branch = False
|
||||||
parsed_confidence = False
|
parsed_confidence = False
|
||||||
|
|
||||||
for line in lines:
|
for line in lines:
|
||||||
line_stripped = line.strip()
|
line_stripped = line.strip()
|
||||||
line_lower = line_stripped.lower() # WICHTIG: Variable wieder einführen
|
line_lower = line_stripped.lower() # WICHTIG: Variable wieder einführen
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user