def extract_must_have_sections(): texts = [] for path in sorted(os.listdir(GUIDELINE_DIR)): with open(path, encoding="utf-8", errors="ignore") as f: texts.append(f.read()) sys = "법령·지침 문서를 바탕으로, 보고서에 반드시 들어가야 할 섹션(목차)을 순서대로 나열해 주세요." usr = "\n\n---\n\n".join(texts) return call_gpt(sys, usr).splitlines() # ─── 3) 로우데이터에서 섹션별 내용 뽑기 ───────────