Thuta Learning
LangChain
BasicAIအဆင့်မြင့်

Prompt Templates

LangChainသင်ခန်းစာ 5

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.

နောက်ဆုံးပြင်ဆင်ရက်

Progress ကို ဤ browser (ဤစက်) တွင်သာ သိမ်းထားပါသည်။ အခြားစက်များနှင့် sync မလုပ်ပါ။

ဤသင်ခန်းစာတွင် အမှားတွေ့ပါက အကြောင်းကြားရန်သင့် email app ကို ဤသင်ခန်းစာလိပ်စာ ဖြည့်ပြီးသားဖြင့် ဖွင့်ပေးပါမည် — သင်ကိုယ်တိုင် ပို့မှသာ ပို့မည်ဖြစ်သည်။

Prompt Templates | Thuta Learning