Files
povtornyy-ekzamen-graf-s-re…/README.md
T

61 lines
1.3 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# LangGraph Reflection and Rewrite Workflow
This repository demonstrates a simple **Python** project built with the
[LangGraph](https://github.com/langchain-ai/langgraph) framework.
The workflow consists of two custom nodes:
1. **ReflectNode** Generates a reflection message based on user input.
2. **RewriteNode** Rewrites the reflection into a more formal style.
## Project Structure
```
src/
├── nodes/
│ ├── reflect.py # ReflectNode implementation
│ └── rewrite.py # RewriteNode implementation
├── graph.py # Graph definition
└── main.py # Entry point to run the graph
tests/
├── test_reflect.py
├── test_rewrite.py
└── test_graph.py
requirements.txt
```
## Installation
```bash
# Create a virtual environment (optional but recommended)
python -m venv venv
source venv/bin/activate # On Windows use `venv\Scripts\activate`
# Install dependencies
pip install -r requirements.txt
```
## Running the Workflow
```bash
python src/main.py
```
You should see output similar to:
```
Graph output: {'rewritten': "I notice that you said: 'Hello world'. Let's reflect on that."}
```
## Testing
Run the test suite with `pytest`:
```bash
pytest
```
All tests should pass, confirming that the nodes and graph work as expected.
## License
MIT License