From 4d300fccf94c2e65f88945bcd2b4c325eb4f4f83 Mon Sep 17 00:00:00 2001 From: Sambhav Dixit <94298612+sambhavnoobcoder@users.noreply.github.com> Date: Sun, 27 Oct 2024 19:08:25 +0530 Subject: [PATCH] Add basic test for log_step_metadata method - Implemented test_log_step_metadata_basic to verify the correct logging of step metadata including step_id, timestamp, tokens, and memory usage. - Confirmed that the token counts for total are accurately logged. --- tests/agents/test_agent_logging.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/tests/agents/test_agent_logging.py b/tests/agents/test_agent_logging.py index 13675858..c68e9aa0 100644 --- a/tests/agents/test_agent_logging.py +++ b/tests/agents/test_agent_logging.py @@ -22,3 +22,15 @@ class TestAgentLogging(unittest.TestCase): short_memory=self.mock_short_memory, long_term_memory=self.mock_long_memory ) + + def test_log_step_metadata_basic(self): + log_result = self.agent.log_step_metadata(1, "Test prompt", "Test response") + + self.assertIn('step_id', log_result) + self.assertIn('timestamp', log_result) + self.assertIn('tokens', log_result) + self.assertIn('memory_usage', log_result) + + self.assertEqual(log_result['tokens']['total'], 200) + +