Update README.md
This commit is contained in:
@@ -1,32 +1,33 @@
|
||||
# LangGraph Agent with Conversation Memory and User Confirmation
|
||||
|
||||
## Installation
|
||||
# Agent CLI Tool
|
||||
|
||||
## Установка
|
||||
```bash
|
||||
python -m venv .venv
|
||||
source .venv/bin/activate # on Windows use `.venv\Scripts\activate`
|
||||
source .venv/bin/activate # Windows: .venv\Scripts\activate
|
||||
pip install -r requirements.txt
|
||||
```
|
||||
|
||||
## Environment Variables
|
||||
|
||||
The agent uses the default OpenAI endpoint via `langchain`. If you want to override, set:
|
||||
|
||||
- `OPENAI_API_KEY` – your OpenAI API key.
|
||||
- `OPENAI_BASE_URL` – custom base URL (e.g., for local Ollama).
|
||||
|
||||
## Running the Agent
|
||||
## Конфигурация
|
||||
Для работы с локальной моделью (Ollama, LM Studio) укажите переменные окружения:
|
||||
```
|
||||
export OPENAI_API_KEY=ollama
|
||||
export OPENAI_BASE_URL=http://localhost:11434/v1
|
||||
```
|
||||
Если используете удалённый API, поменяйте `base_url` и `api_key` в `agent.py`.
|
||||
|
||||
## Запуск
|
||||
```bash
|
||||
python agent.py
|
||||
```
|
||||
|
||||
The script starts with an empty conversation history. The graph will:
|
||||
1. Retrieve memory (currently just echoes the existing history).
|
||||
2. Invoke a placeholder agent that would normally process the conversation.
|
||||
3. Prompt you to confirm each tool call via Rich console output.
|
||||
4. Continue execution after confirmation.
|
||||
## Пример
|
||||
```
|
||||
Добро пожаловать! Введите 'exit' для выхода.
|
||||
|
||||
## Extending
|
||||
Вы: Какая погода в Казани сегодня?
|
||||
Tool call detected: get_price{'city': 'Казань', 'date': 'сегодня'}
|
||||
Разрешить? (Y/n): y
|
||||
Цена в Казань на сегодня: 1000₽
|
||||
|
||||
Replace `agent_node` with real LangChain logic, add tools, and integrate an actual LLM model as needed.
|
||||
---
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user