From 672f3eeab449564f3986a80f971eb5b38b984ba1 Mon Sep 17 00:00:00 2001 From: Sambhav Dixit <94298612+sambhavnoobcoder@users.noreply.github.com> Date: Sun, 27 Oct 2024 19:09:35 +0530 Subject: [PATCH] Add test for log_step_metadata with no long-term memory - Implemented test_log_step_metadata_no_long_term_memory to ensure that when long-term memory is None, the memory_usage for long_term is an empty dictionary in the log result. --- tests/agents/test_agent_logging.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/agents/test_agent_logging.py b/tests/agents/test_agent_logging.py index c68e9aa0..cbfb8b80 100644 --- a/tests/agents/test_agent_logging.py +++ b/tests/agents/test_agent_logging.py @@ -33,4 +33,8 @@ class TestAgentLogging(unittest.TestCase): self.assertEqual(log_result['tokens']['total'], 200) + def test_log_step_metadata_no_long_term_memory(self): + self.agent.long_term_memory = None + log_result = self.agent.log_step_metadata(1, "prompt", "response") + self.assertEqual(log_result['memory_usage']['long_term'], {})