Moved context generation to base agent instead of system_metrics
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user