Thuta Learning
BasicAIadvanced

Models (LLMs & Chat)

Relax. We'll talk through this in plain words — no textbook voice.

LangChain works with two kinds of language models:

LLMs: models that take a text string as input and return a text string (e.g., "Tell me a joke." -> "Why don't scientists trust atoms? ...")

Chat Models: take a list of chat messages as input and return a single chat message. (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.
Models (LLMs & Chat) | Thuta Learning