Moved context generation to base agent instead of system_metrics

This commit is contained in:
Niels Geens
2024-11-14 14:51:54 +01:00
parent 325870a81a
commit ede0a642d3
6 changed files with 139 additions and 209 deletions

View File

@@ -22,21 +22,17 @@ class WebSocketManagerTest(AioHTTPTestCase):
self.io_buffer = WebIOBuffer()
self.working_memory = WorkingMemory()
# Create mock metrics with proper generate_context implementation
# Create mock metrics with proper get_metrics implementation
self.mock_metrics = Mock(spec=SystemMetrics)
metrics_elem = ET.Element("context")
metrics_elem.attrib = {
"time": "2024-10-31T12:00:00Z",
"cpu": "10",
"gpu": "20",
"memory_used": "1000",
"memory_total": "2000",
"disk_used": "5000",
"disk_total": "10000",
"context": "0",
"stdin": "0"
self.mock_metrics.get_metrics.return_value = {
"timestamp": "2024-10-31T12:00:00Z",
"cpu": 10,
"gpu": 20,
"memory_used": 1000,
"memory_total": 2000,
"disk_used": 5000,
"disk_total": 10000
}
self.mock_metrics.generate_context.return_value = metrics_elem
# Create minimal mocks for other components
self.mock_llm = Mock(spec=LlmEngine)