Thuta Learning
ရှာဖွေရန်
BasicAIadvanced

Prompt Templates

စိတ်လျှော့ပါ။ ဒီခန်းကို စာအုပ်လိုမဟုတ်ဘဲ စကားပြောသလိုပဲ၊ နားလည်လွယ်အောင် ရှင်းပါမယ်။

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.
Prompt Templates | Thuta Learning