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

Models (LLMs & Chat)

LangChainသင်ခန်းစာ 4

LangChain တွင် language models နှစ်မျိုးရှိသည်:

• LLMs: Text string ကို input အဖြစ်လက်ခံပြီး text string ကို return ပြန်ပေးသော model (e.g., "Tell me a joke." -> "Why don't scientists trust atoms? ...")

• Chat Models: List of chat messages များကို input အဖြစ်လက်ခံပြီး chat message တစ်ခုကို return ပြန်ပေးသည်။ (e.g., System, Human, AI messages)

python
from langchain_openai import ChatOpenAI

# Initialize the chat model
chat = ChatOpenAI(model="gpt-3.5-turbo", temperature=0)

# Invoke the model with a message
response = chat.invoke("what is the capital of Myanmar?")

print(response.content)
You should see
The capital of Myanmar is Naypyidaw.

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

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

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

Models (LLMs & Chat) | Thuta Learning