From 972fc23bfc19e79a6604f2543ee7fcbc7e40256a Mon Sep 17 00:00:00 2001 From: MrKan Date: Mon, 20 Apr 2026 13:21:26 +0300 Subject: [PATCH] =?UTF-8?q?=D0=B0=D0=BA=D1=82=D1=83=D0=B0=D0=BB=D1=8C?= =?UTF-8?q?=D0=BD=D1=8B=D0=B9=20README=20=D0=B8=20menual=20=D1=82=D0=B5?= =?UTF-8?q?=D1=81=D1=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 1 + tests/manual.py | 11 ++++++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index ccc0115..dd88b72 100644 --- a/README.md +++ b/README.md @@ -9,6 +9,7 @@ WebSocket API SDK для взаимодействия с AI-агентом. - Добавлен параметр `chat_id` в конструктор `AgentAPI`. Нужен для разделения истории сообщений по чатам/веткам. - `AgentAPI.connect()` вызывает `AgentBusyException`, если выбранный чат уже занят другим API клиентом. - Добавлен новый тип события `MsgEventSendFile` для отправки файлов пользователю. Поле `path` — путь к файлу относительно `/workspace`. +- `send_message(text, attachments)` теперь принимает `attachments` — список путей к файлам относительно `/workspace`. ## Установка В `master` всегда будет актуальная рабочая версия. diff --git a/tests/manual.py b/tests/manual.py index 44adea2..0c7c657 100644 --- a/tests/manual.py +++ b/tests/manual.py @@ -23,9 +23,18 @@ async def main(): while True: try: prompt = await asyncio.get_event_loop().run_in_executor(None, input, ">>> ") + attachments_input = await asyncio.get_event_loop().run_in_executor( + None, input, "Attachments (comma-separated, empty for none): " + ) + attachments = ( + [a.strip() for a in attachments_input.split(",") if a.strip()] + if attachments_input.strip() + else None + ) + print("Agent: ", end="") is_tool = False - async for chunk in api.send_message(prompt): + async for chunk in api.send_message(prompt, attachments): match chunk: case MsgEventTextChunk(): is_tool = False