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

Retrieval Chain

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

RAG တွင်, user query နှင့် အကိုက်ညီဆုံးဖြစ်သော documents များကို vector store မှ Retriever ဖြင့် ရှာဖွေသည်။ ထို့နောက် ထို documents များနှင့် မူရင်း query ကို LLM သို့ပို့ပြီး အဖြေကို generate လုပ်စေသည်။

python
# Create a retriever from the vector store
retriever = vectorstore.as_retriever()

# Create a chain that combines the retrieved documents and the question
# and sends it to the LLM.
# (This requires a more complex chain setup)

response = qa_chain.invoke({"query": "What is the main topic of the document?"})
You should see
(LLM သည် သင်ပေးထားသော document ထဲမှ information ကို အခြေခံ၍ အဖြေကို ပြန်ပေးမည်)
Retrieval Chain | Thuta Learning