feat: solution for 'Экзамен: Самокорректирующийся агент'
This commit is contained in:
@@ -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.
|
||||
|
||||
---
|
||||
Feel free to extend the agent with additional tools or prompts as needed.
|
||||
+16
-11
@@ -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.
|
||||
**Ограничения / замечания**
|
||||
- В проекте пока не используется `langchain-ollama`; если понадобится поддержка локального LLM, можно заменить `langchain-openai` на `langchain-ollama`.
|
||||
- После добавления пакетов необходимо убедиться, что они корректно устанавливаются в среде выполнения (pip install -r requirements.txt).
|
||||
+2
-1
@@ -1 +1,2 @@
|
||||
langgraph
|
||||
langchain-core
|
||||
langchain-openai
|
||||
Reference in New Issue
Block a user