diff --git a/helpers.py b/helpers.py index e047b026..c0f3586d 100644 --- a/helpers.py +++ b/helpers.py @@ -36,7 +36,10 @@ from bs4 import BeautifulSoup import pandas as pd import openai from openai.error import AuthenticationError, OpenAIError, RateLimitError, APIError, Timeout, InvalidRequestError, ServiceUnavailableError -from config import Config, BRANCH_MAPPING_FILE, URL_CHECK_MARKER, USER_AGENTS, LOG_DIR +from config import (Config, BRANCH_MAPPING_FILE, URL_CHECK_MARKER, + USER_AGENTS, LOG_DIR, TARGET_SCHEMA_STRING, + ALLOWED_TARGET_BRANCHES, FOCUS_TARGET_BRANCHES, + FOCUS_BRANCHES_PROMPT_PART) # Optionale Bibliotheken try: @@ -901,8 +904,12 @@ def evaluate_branche_chatgpt(crm_branche, beschreibung, wiki_branche, wiki_kateg NUTZT DIE BEWÄHRTE PARSING-LOGIK AUS v1.7.9. """ logger = logging.getLogger(__name__) - from config import TARGET_SCHEMA_STRING, FOCUS_BRANCHES_PROMPT_PART, ALLOWED_TARGET_BRANCHES + # HINWEIS: Die globalen Variablen TARGET_SCHEMA_STRING, FOCUS_BRANCHES_PROMPT_PART + # und ALLOWED_TARGET_BRANCHES werden auf Modulebene importiert und von + # initialize_target_schema() modifiziert. Wir dürfen sie hier nicht erneut importieren. + + # Lazy Loading des Branchenschemas if not ALLOWED_TARGET_BRANCHES: logger.warning("Branchenschema nicht geladen. Versuche es jetzt zu laden...") if not initialize_target_schema():