Skip to content

Commit

Permalink
Add basic test for log_step_metadata method
Browse files Browse the repository at this point in the history
- 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.
  • Loading branch information
sambhavnoobcoder authored Oct 27, 2024
1 parent ef58dd4 commit 4d300fc
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions tests/agents/test_agent_logging.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,15 @@ def setUp(self):
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)


0 comments on commit 4d300fc

Please sign in to comment.