Files
_Geulbeot/02. Prompts/문서생성/codedomain/보고서_섹션에_Python_v01.py

16 lines
603 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 pick_images_for(section: str):
names = sorted(os.listdir(IMAGE_DIR))
prompt = (
f"보고서 {section} 섹션에 적합한 이미지를 아래 목록에서 1~2개 추천해 파일명만 리턴하세요:\n"
+ "\n".join(names)
)
resp = call_gpt("당신은 디자인 어시스턴트입니다.", prompt)
picked = []
for line in resp.splitlines():
fn = line.strip()
if fn in names:
picked.append(fn)
return picked
# ─── 5) 디자인 템플릿 선택 ───────────────────────