LangChain 1 · Prompts and chains

Create a prompt template

Build a reusable prompt with placeholders.

from langchain_core.prompts import ChatPromptTemplate

prompt = ChatPromptTemplate.from_messages([
    ("system", "Translate the user's text into {language}."),
    ("human", "{text}"),
])

Official LangChain 1 documentation

More prompts and chains commands

All prompts and chains commands · LangChain 1 cheatsheet

Was this page helpful?