File size: 1,195 Bytes
c4ab5fa d234e06 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 |
"""
Parent Chunk ๋ถ์ ํ๋กฌํํธ
"""
from typing import Optional
def get_parent_chunk_analysis_prompt(
content: str,
max_length: int = 8000
) -> str:
"""
Parent Chunk ๋ถ์์ ์ํ ํ๋กฌํํธ ์์ฑ
Args:
content: ๋ถ์ํ ์ ์ฒด ํ
์คํธ
max_length: ํ๋กฌํํธ์ ํฌํจํ ์ต๋ ํ
์คํธ ๊ธธ์ด
Returns:
ํ๋กฌํํธ ๋ฌธ์์ด
"""
content_preview = content[:max_length]
is_truncated = len(content) > max_length
truncation_note = "\n(์ฐธ๊ณ : ํ
์คํธ๊ฐ ๊ธธ์ด ์ผ๋ถ๋ง ์ฌ์ฉ๋์์ต๋๋ค.)" if is_truncated else ""
prompt = f"""๋ค์ ์น์์ค ํ
์คํธ๋ฅผ ๋ถ์ํ์ฌ ์ธ๊ณ๊ด, ์บ๋ฆญํฐ, ์คํ ๋ฆฌ, ์ํผ์๋, ๊ธฐํ ์ ๋ณด๋ฅผ ์ถ์ถํ์ธ์.
ํ
์คํธ:
{content_preview}{truncation_note}
๋ค์ ํ์์ผ๋ก ์๋ตํ์ธ์:
## ์ธ๊ณ๊ด
[์ธ๊ณ๊ด์ ๋ํ ์์ธ ์ค๋ช
]
## ์บ๋ฆญํฐ
[์ฃผ์ ์บ๋ฆญํฐ๋ค์ ํน์ง๊ณผ ๋ฐฐ๊ฒฝ]
## ์คํ ๋ฆฌ
[์ฃผ์ ์คํ ๋ฆฌ ๋ผ์ธ๊ณผ ์ ๊ฐ]
## ์ํผ์๋
[์ฃผ์ ์ํผ์๋์ ์ฌ๊ฑด๋ค]
## ๊ธฐํ
[๊ธฐํ ์ค์ํ ์ ๋ณด]
๊ฐ ์น์
์ ์์ธํ๊ณ ๊ตฌ์กฐํ๋ ํํ๋ก ์์ฑํด์ฃผ์ธ์."""
return prompt
|