Skip to main content

3 docs tagged with "lcel"

View all tags

Pipe Chaining with LCEL

The | operator builds a RunnableSequence, as introduced in Runnables and LCEL. Each step's output becomes the next step's input, and the types have to line up — a prompt template's PromptValue output must be something the chat model's invoke accepts, and so on down the chain.

Runnables and LCEL

Every composable piece in LangChain — prompts, chat models, parsers, retrievers, custom functions — implements the same interface: Runnable. LCEL (LangChain Expression Language) is just the | operator composing Runnables into a RunnableSequence, as shown in Your First Chain.

Your First Chain

A minimal chain: a prompt template feeds a chat model, whose output feeds a parser. The | operator wires them together.