Prompt Templates များသည် user input နှင့် အခြား information များမှ prompt များကို dynamically တည်ဆောက်ရန်ဖြစ်သည်။ ၎င်းသည် LLM အတွက် input ကို reusable နှင့် consistent ဖြစ်စေသည်။
python
from langchain.prompts import PromptTemplate
prompt_template = PromptTemplate.from_template(
"Tell me a short joke about {subject}."
)
# Create a prompt by formatting the template
prompt = prompt_template.format(subject="a cat")
print(prompt)
# This prompt can now be sent to an LLM.You should see
Tell me a short joke about a cat.