From bd516cee43a23718010a275b749c8ed312357e34 Mon Sep 17 00:00:00 2001 From: collhoun <2904yr@mail.ru> Date: Wed, 8 Apr 2026 11:29:15 +0300 Subject: [PATCH] =?UTF-8?q?#5=20=D0=A0=D0=B5=D0=B0=D0=BB=D0=B8=D0=B7=D0=BE?= =?UTF-8?q?=D0=B2=D0=B0=D1=82=D1=8C=20=D0=BA=D0=BB=D0=B8=D0=B5=D0=BD=D1=82?= =?UTF-8?q?=D1=81=D0=BA=D1=83=D1=8E=20=D1=87=D0=B0=D1=81=D1=82=D1=8C=20?= =?UTF-8?q?=D0=BA=D0=B0=D0=BD=D0=B0=D0=BB=D0=B0=20=D0=BE=D0=B1=D1=89=D0=B5?= =?UTF-8?q?=D0=BD=D0=B8=D1=8F.=20=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=D0=B0=20=D0=BE=D0=B1=D1=80=D0=B0=D0=B1=D0=BE=D1=82?= =?UTF-8?q?=D0=BA=D0=B0=20=D0=B8=D0=BD=D0=B2=D0=B5=D0=BD=D1=82=D0=BE=D0=B2?= =?UTF-8?q?=20=D0=BD=D0=BE=D0=B2=D1=8B=D1=85=20=D0=BC=D0=BE=D0=B4=D0=B5?= =?UTF-8?q?=D0=BB=D0=B5=D0=B9=20=D1=81=D0=BE=D0=B1=D1=8B=D1=82=D0=B8=D0=B9?= =?UTF-8?q?=20=D0=B0=D0=B3=D0=B5=D0=BD=D1=82=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lambda_agent_api/agent_api.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/lambda_agent_api/agent_api.py b/lambda_agent_api/agent_api.py index 544c090..d130bcf 100644 --- a/lambda_agent_api/agent_api.py +++ b/lambda_agent_api/agent_api.py @@ -226,20 +226,19 @@ class AgentApi: outgoing_msg = ServerMessage.validate_json( msg.data) - if isinstance(outgoing_msg, MsgEventTextChunk): + if isinstance(outgoing_msg, (MsgEventTextChunk, + MsgEventToolCallChunk, + MsgEventToolResult, + MsgEventCustomUpdate, + MsgEventEnd)): if self._current_queue: await self._current_queue.put(outgoing_msg) - # Если очереди нет (клиент отменил запрос), но токены идут — шлем их в коллбек elif self.callback: self.callback(outgoing_msg) else: logger.warning( f"[{self.id}] AgentEvent without active request") - elif isinstance(outgoing_msg, MsgEventEnd): - if self._current_queue: - await self._current_queue.put(outgoing_msg) - elif isinstance(outgoing_msg, MsgError): if self.callback: self.callback(outgoing_msg)