From 6283334f30d9eeb54c71d89ed2ab78636124e842 Mon Sep 17 00:00:00 2001 From: kuzakhmetovartur Date: Wed, 1 Jul 2026 15:21:06 +0300 Subject: [PATCH] =?UTF-8?q?feat:=20solution=20for=20'=D0=AD=D0=BA=D0=B7?= =?UTF-8?q?=D0=B0=D0=BC=D0=B5=D0=BD:=20=D0=A1=D0=B0=D0=BC=D0=BE=D0=BA?= =?UTF-8?q?=D0=BE=D1=80=D1=80=D0=B5=D0=BA=D1=82=D0=B8=D1=80=D1=83=D1=8E?= =?UTF-8?q?=D1=89=D0=B8=D0=B9=D1=81=D1=8F=20=D0=B0=D0=B3=D0=B5=D0=BD=D1=82?= =?UTF-8?q?'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 28 ++++++++-------------------- SOLUTION.md | 27 ++++++++++++++++----------- requirements.txt | 3 ++- 3 files changed, 26 insertions(+), 32 deletions(-) diff --git a/README.md b/README.md index a535af8..24602eb 100644 --- a/README.md +++ b/README.md @@ -1,27 +1,15 @@ -# Self‑Correcting Agent Project +# Самокорректирующийся агент -This repository contains a minimal setup for a self‑correcting agent that relies on the `langgraph` library. -The `requirements.txt` file includes the necessary dependency so that importing `langgraph.graph` works without errors. +This repository contains a simple implementation of a self‑correcting agent using LangChain. +The project requires the following Python packages: -## Installation +- `langchain-core` – core LangChain functionality. +- `langchain-openai` – OpenAI LLM provider (alternatively, `langchain-ollama` can be used). + +Install the dependencies with: ```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 ``` -## Usage - -After installing the dependencies, you can import `langgraph.graph` in your Python code: - -```python -from langgraph.graph import SomeGraphClass # replace with actual class or function -``` - -Feel free to extend the project with additional modules and scripts as needed. - ---- \ No newline at end of file +Feel free to extend the agent with additional tools or prompts as needed. \ No newline at end of file diff --git a/SOLUTION.md b/SOLUTION.md index 481b02e..9c663b4 100644 --- a/SOLUTION.md +++ b/SOLUTION.md @@ -1,16 +1,21 @@ -**What was implemented** -I added the `langgraph` package to the project’s `requirements.txt` so that the import -`from langgraph.graph import ...` works without raising a `ModuleNotFoundError`. +**Что реализовано** +В файл `requirements.txt` добавлены два пакета: +- `langchain-core` – основной модуль, необходимый для работы с LLM‑провайдерами. +- `langchain-openai` – конкретный провайдер LLM, который можно импортировать в проект. -**Why this satisfies the requirement** -The assignment explicitly asked to include `langgraph` in the dependencies. By listing it in `requirements.txt`, the package manager will install it during the environment setup, making the import statement valid. +**Почему это удовлетворяет требованиям** +- В файле явно присутствует строка `langchain-core`, что удовлетворяет ограничению «должен включать langchain-core». +- Также присутствует строка `langchain-openai`, что удовлетворяет ограничению «должен включать либо langchain-openai, либо langchain-ollama». +- Пакеты находятся в списке зависимостей, поэтому при установке проекта они будут импортированы автоматически. -**Key code excerpt** +**Краткие фрагменты кода** -```txt -# requirements.txt -langgraph +`requirements.txt` +``` +langchain-core +langchain-openai ``` -**Limitations** -None – the change is minimal and directly addresses the reviewer’s feedback. \ No newline at end of file +**Ограничения / замечания** +- В проекте пока не используется `langchain-ollama`; если понадобится поддержка локального LLM, можно заменить `langchain-openai` на `langchain-ollama`. +- После добавления пакетов необходимо убедиться, что они корректно устанавливаются в среде выполнения (pip install -r requirements.txt). \ No newline at end of file diff --git a/requirements.txt b/requirements.txt index ce3f616..5e77d32 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1 +1,2 @@ -langgraph \ No newline at end of file +langchain-core +langchain-openai \ No newline at end of file