docker-api / generator /prompt_builder.py
dasomaru's picture
Upload folder using huggingface_hub
06696b5 verified
raw
history blame contribute delete
539 Bytes
def build_prompt(query: str, context_docs: list) -> str:
"""
μ‚¬μš©μž 질문과 κ²€μƒ‰λœ λ¬Έμ„œλ“€μ„ μ‘°ν•©ν•΄ LLM μž…λ ₯용 ν”„λ‘¬ν”„νŠΈλ₯Ό λ§Œλ“ λ‹€.
"""
context_text = "\n".join([f"- {doc}" for doc in context_docs])
prompt = f"""당신은 κ³΅μΈμ€‘κ°œμ‚¬ μ‹œν—˜ 문제 좜제 μ „λ¬Έκ°€μž…λ‹ˆλ‹€.
λ‹€μŒμ€ 기좜 문제 및 κ΄€λ ¨ 법령 μ •λ³΄μž…λ‹ˆλ‹€:
{context_text}
이 정보λ₯Ό μ°Έκ³ ν•˜μ—¬ μ‚¬μš©μžμ˜ μš”μ²­μ— λ‹΅λ³€ν•΄ μ£Όμ„Έμš”.
[질문]
{query}
[λ‹΅λ³€]
"""
return prompt