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

Memory

LangChainသင်ခန်းစာ 8

Memory သည် chains များကို ယခင် conversations များကို မှတ်မိစေရန် ထည့်သွင်းပေးသော component ဖြစ်သည်။ ConversationBufferMemory သည် chat history ကို variable တစ်ခုတွင် သိမ်းဆည်းပေးသည်။

python
from langchain.memory import ConversationBufferMemory

# Setup memory
memory = ConversationBufferMemory()

# Add memory to an LLMChain
chain = LLMChain(llm=llm, prompt=prompt, memory=memory)

# The first time, the memory is empty.
# The second time, the chain will "remember" the first conversation.
You should see
(Memory ကိုအသုံးပြုခြင်းဖြင့် chatbot သည် ယခင်ပြောခဲ့သော စကားများကို မှတ်မိနိုင်သည်)

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

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

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

Memory | Thuta Learning