■ PromptTemplate 클래스를 사용해 특별한 형식의 문서 요약문 프롬프트를 만드는 방법을 보여준다.
▶ 예제 코드 (PY)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
from langchain.prompts import PromptTemplate promptTemplateString = """You are a helpful expert in summary writing. You are given lists of summaries. Please sum up previously summarized sentences according to the following REQUEST. REQUEST : 1. Summarize the main points in bullet points in KOREAN. 2. Each summarized sentence must start with an emoji that fits the meaning of the each sentence. 3. Use various emojis to make the summary more interesting. 4. MOST IMPORTANT points should be organized at the top of the list. 5. DO NOT include any unnecessary information. LIST OF SUMMARIES : {doc_summaries} Helpful Answer : """ promptTemplate = PromptTemplate.from_template(promptTemplateString) |
※ pip install langchain 명령을 실행했다.