Enable verbose output for a chain
To print lifecycle messages and the fully formatted prompt (placeholders replaced), passverbose=True when constructing the component:
What the verbose flag exposes
Verbose is a targeted debugging aid that reveals key runtime information for a component. It typically provides:Use verbose selectively
Enableverbose=True only on the component(s) you need to inspect. This focused approach avoids overwhelming output from other parts of your system while giving clear visibility into the component under investigation.
Use
verbose=True on only the components you need to inspect. Global debug or tracing options can produce a large amount of output; verbose is a targeted way to get helpful runtime visibility.Example input data
Below is the input dictionary used in the examples (shown in a code block to avoid MDX parsing issues):Routing verbose output with callbacks
If you prefer structured logging or tracing, LangChain callbacks let you capture verbose events and route them to custom handlers (for example, sending logs to a monitoring system, or collecting them in a structured store). Use callbacks to integrate verbose output with your observability stack. For more details, see:- LangChain documentation: https://langchain.readthedocs.io/
- ChatOpenAI: https://pypi.org/project/langchain-openai/