docker-api / utils /prompt.py
dasomaru's picture
Upload folder using huggingface_hub
06696b5 verified
raw
history blame contribute delete
647 Bytes
from generator.prompt_builder_all import build_prompt as build_prompt_all
def build_prompt_all(query, law_docs, exam_docs):
# law_docs / exam_docs: list of reranked document strings
law_str = "\n\n".join(law_docs)
exam_str = "\n\n".join(exam_docs)
system_msg = "당신은 κ³΅μΈμ€‘κ°œμ‚¬ μ‹œν—˜ 문제 좜제 μ „λ¬Έκ°€μž…λ‹ˆλ‹€."
guidance = "μ•„λž˜λŠ” κ΄€λ ¨ 법령과 κΈ°μΆœλ¬Έμ œμž…λ‹ˆλ‹€:\n"
prompt = f"""{system_msg}\n\n{guidance}
[법령 정보]
{law_str}
[기좜문제 정보]
{exam_str}
[질문]
{query}
[μ§€μ‹œμ‚¬ν•­]
- μ •ν™•ν•˜κ³  λͺ…ν™•ν•˜κ²Œ λ‹΅λ³€ν•˜μ„Έμš”."""
return prompt