From 1a97d76fbc227321913339002764304fffdea3d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A0=D0=B8=D0=BD=D0=B0=D1=80=20=D0=9C=D0=B8=D1=80=D0=B7?= =?UTF-8?q?=D0=B0=D0=B3=D0=B8=D1=82=D0=BE=D0=B2?= Date: Thu, 18 Jun 2026 12:52:33 +0000 Subject: [PATCH] =?UTF-8?q?=D0=A0=D0=B5=D1=88=D0=B5=D0=BD=D0=B8=D0=B5=20?= =?UTF-8?q?=D0=B3=D0=BE=D1=82=D0=BE=D0=B2=D0=BE=20=D0=BA=20=D0=BF=D1=83?= =?UTF-8?q?=D0=B1=D0=BB=D0=B8=D0=BA=D0=B0=D1=86=D0=B8=D0=B8:=20update=20RE?= =?UTF-8?q?ADME.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 36 +++++++++++++++--------------------- 1 file changed, 15 insertions(+), 21 deletions(-) diff --git a/README.md b/README.md index 9e2e192..15cbaa2 100644 --- a/README.md +++ b/README.md @@ -1,35 +1,29 @@ # README.md # LangGraph Code Review Agent -## Description +This repository implements a **LangGraph** agent that takes a Python function as input and produces a code review. The review is evaluated by a critic node that scores it on four criteria: -This repository contains a **LangGraph** implementation that performs automated code reviews for a given Python function. The agent: +1. **PEP8 compliance** +2. **Type hints** +3. **Edge case handling** +4. **Naming conventions** -1. Generates an initial draft review. -2. Critiques the draft using four criteria (PEP8, type hints, edge cases, naming). -3. If the review is not satisfactory, rewrites the weak part up to a maximum number of rounds. +If the critic returns **`needs_revision`** the rewrite node improves the weakest part of the review. The process repeats up to ``max_rounds`` times. -The demo function `sort_numbers` is used in the CLI example. +The implementation uses only the technologies specified in the assignment: ``langgraph`` and ``langchain-ollama`` (or ``langchain-openai`` if you prefer). No vector database is used. -## How to run +## Installation ```bash -# Install dependencies pip install -r requirements.txt +``` -# Run the demo +## Demo + +Run the demo with: + +```bash python main.py ``` -The script will print the final state of the review process. - -## Requirements - -- Python 3.10+ -- LangGraph -- LangChain OpenAI -- python-dotenv (for optional API key handling) - -## License - -MIT +It will review the example function ``sort_numbers`` and print the draft review, scores, and verdict.