Langchain Decorators
Freea layer on the top of LangChain that provides syntactic sugar 🍭 for writing custom langchain prompts and chains 
About Langchain Decorators
LangChain Decorators is a lightweight, unofficial layer built on top of LangChain that provides syntactic sugar for writing custom prompts and chains. It offers a more Pythonic way to define prompts using functions and docstrings, with full IDE support for type hints and parameter documentation. The library supports multi-line prompts without indentation issues, optional parameters, chat message roles, output parsers, session management, tool calling, enum arguments, streaming, structured output, and easy parameter sharing by binding prompts to a class. It maintains full compatibility with the LangChain ecosystem.
Key Features
Pros & Cons
- More Pythonic and concise than raw LangChain prompt templates
- Full IDE support improves developer experience and reduces errors
- Supports optional parameters, making prompts flexible and reusable
- Easy to document prompts directly in the function docstring
- Maintains full compatibility with the LangChain ecosystem and tools
- Unofficial add-on, not maintained or endorsed by the LangChain team
- Opinionated design may not fit every workflow or preference
- Smaller community and less documentation compared to LangChain itself
- Potential compatibility issues with future LangChain updates