From 061b6623db2e34799168bab3de6975f5798fab34 Mon Sep 17 00:00:00 2001 From: Charles Packer Date: Sun, 8 Dec 2024 23:14:18 -0800 Subject: [PATCH] fix: bad print in common cli (#2200) --- letta/orm/sqlalchemy_base.py | 2 +- tests/test_client.py | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/letta/orm/sqlalchemy_base.py b/letta/orm/sqlalchemy_base.py index 2fd6394724..4507f51c27 100644 --- a/letta/orm/sqlalchemy_base.py +++ b/letta/orm/sqlalchemy_base.py @@ -187,7 +187,7 @@ def hard_delete(self, db_session: "Session", actor: Optional["User"] = None) -> logger.exception(f"Failed to hard delete {self.__class__.__name__} with ID {self.id}") raise ValueError(f"Failed to hard delete {self.__class__.__name__} with ID {self.id}: {e}") else: - logger.info(f"{self.__class__.__name__} with ID {self.id} successfully hard deleted") + logger.debug(f"{self.__class__.__name__} with ID {self.id} successfully hard deleted") def update(self, db_session: "Session", actor: Optional["User"] = None) -> Type["SqlalchemyBase"]: logger.debug(f"Updating {self.__class__.__name__} with ID: {self.id} with actor={actor}") diff --git a/tests/test_client.py b/tests/test_client.py index 6a0db9933b..866bd2012b 100644 --- a/tests/test_client.py +++ b/tests/test_client.py @@ -292,6 +292,12 @@ def test_messages(client: Union[LocalClient, RESTClient], agent: AgentState): assert len(messages_response) > 0, "Retrieving messages failed" +def test_send_system_message(client: Union[LocalClient, RESTClient], agent: AgentState): + """Important unit test since the Letta API exposes sending system messages, but some backends don't natively support it (eg Anthropic)""" + send_system_message_response = client.send_message(agent_id=agent.id, message="Event occured: The user just logged off.", role="system") + assert send_system_message_response, "Sending message failed" + + @pytest.mark.asyncio async def test_send_message_parallel(client: Union[LocalClient, RESTClient], agent: AgentState, request): """