File size: 539 Bytes
2c5f455
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
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