Files
_Geulbeot/02. Prompts/문서생성/codedomain/다음_로우데이터를_Python_v01.py

13 lines
547 B
Python
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
def summarize_data_for(section: str):
texts = []
for path in sorted(os.listdir(DATA_DIR)):
with open(path, encoding="utf-8", errors="ignore") as f:
texts.append(f.read())
prompt = (
f"다음 로우데이터를 바탕으로 {section} 섹션에 들어갈 핵심 사실과 수치를 200~300자로 요약해주세요.\n\n"
+ "\n\n".join(texts)
)
return call_claude(prompt)
# ─── 4) 이미지 자동 매핑 ─────────────────────────