From af6701671b2d046a1a063093f606d3c73165ab8e Mon Sep 17 00:00:00 2001 From: kuzakhmetovartur Date: Wed, 24 Jun 2026 15:31:31 +0300 Subject: [PATCH] =?UTF-8?q?feat:=20solution=20for=20'=D0=9F=D1=80=D0=B0?= =?UTF-8?q?=D0=BA=D1=82=D0=B8=D1=87=D0=B5=D1=81=D0=BA=D0=BE=D0=B5=20=D0=B7?= =?UTF-8?q?=D0=B0=D0=B4=D0=B0=D0=BD=D0=B8=D0=B5=20=E2=84=963:=20=D0=9F?= =?UTF-8?q?=D0=B0=D0=BC=D1=8F=D1=82=D1=8C=20=D0=B8=20=D0=BF=D0=BE=D0=B4?= =?UTF-8?q?=D1=82=D0=B2=D0=B5=D1=80=D0=B6=D0=B4=D0=B5=D0=BD=D0=B8=D0=B5=20?= =?UTF-8?q?=D0=B4=D0=B5=D0=B9=D1=81=D1=82=D0=B2=D0=B8=D0=B9'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 79 ++++++++++++++++++------------------------------------- 1 file changed, 25 insertions(+), 54 deletions(-) diff --git a/README.md b/README.md index 89c9e0b..9f430c6 100644 --- a/README.md +++ b/README.md @@ -1,62 +1,33 @@ -# LangGraph Agent with Memory and Tool Confirmation +# Практическое задание №3: Память и подтверждение действий -This project demonstrates a simple conversational agent built with **LangGraph** that: +Главная +Мои задания +Практическое задание №3: Память и подтверждение действий +5Д +EN +Практическое задание №3: Память и подтверждение действий +Зачёт +Версия 4 +Дедлайн сдачи: 31.08.2026 -- **Remembers** the conversation history across turns using an in‑memory checkpoint. -- **Pauses** before invoking any tool, asking the user for confirmation. -- Uses the **Rich** library for pretty console output. +В работе -## Prerequisites +Редактирование ответа -- Python 3.10+ -- An OpenAI API key (set as the `OPENAI_API_KEY` environment variable). +Заполните ответ и отправьте работу на проверку преподавателю. -## Installation +Тип ответа +Текст +Ссылка +Файлы +Ссылка (URL) +Прикреплённые файлы +Загрузить файл +Отправить на проверку +Отменить -```bash -# Clone the repository (or copy the files) -git clone https://github.com/yourusername/langgraph-agent.git -cd langgraph-agent +Задание -# Create a virtual environment (optional but recommended) -python -m venv .venv -source .venv/bin/activate # On Windows: .venv\Scripts\activate +Цель -# Install dependencies -pip install -r requirements.txt -``` - -## Usage - -```bash -python src/main.py -``` - -You will see a prompt: - -``` -Start chat. Type 'exit' to quit. -You: -``` - -Type any message. If the agent decides to use a tool (e.g., the `echo` tool), it will pause and ask: - -``` -Agent wants to call tool: echo({"text":"Hello"}) -Разрешить? (Y/n): -``` - -- Type `Y` or press Enter to allow the tool to run. -- Type `n` to cancel the tool call. - -The conversation history is preserved across turns, so the agent can refer back to earlier messages. - -## Customizing - -- **Tools**: Add more tools by defining functions decorated with `@tool` from `langchain.tools`. -- **Memory**: Replace `MemorySaver()` with a persistent checkpoint (e.g., `RedisSaver`) for long‑term storage. -- **Prompt**: Modify the `system_prompt` in `create_agent` to change the agent’s behavior. - -## License - -MIT License \ No newline at end of file +Доработать агента из предыдущих заданий: добавить память разговора и механизм подтверждения каждо \ No newline at end of file