Skip to main content

Chains & LCEL

LCEL Fundamentals

0:00
LearnStep 1/4

The Pipe Operator

LCEL: The Pipe Operator

LCEL (LangChain Expression Language) uses the | operator to compose chains.

Basic Syntax

python

Data Flow

text

Every Component is a Runnable

In LCEL, every component implements the Runnable interface:

  • invoke(input) - Run with single input
  • batch(inputs) - Run with list of inputs
  • stream(input) - Stream output chunks
  • ainvoke(input) - Async invoke