946 B
946 B
LangGraph Reflection Example
This repository demonstrates a simple LangGraph workflow that performs reflection on a Python function's source code. The graph consists of three nodes:
- start_node – Initializes the graph state.
- reflect_node – Uses Python's
inspectmodule to retrieve the source code oftarget_function. - end_node – Prints the reflected source code.
Requirements
- Python 3.x
langchain_openailangchain_corelanggraph
Install the dependencies with:
pip install -r requirements.txt
Running the Example
python src/main.py
You should see the source code of target_function printed to the console.
Project Structure
├── requirements.txt
├── src
│ ├── __init__.py
│ └── main.py
└── README.md
No JavaScript code is included; the entire project is implemented in Python using the LangGraph framework.