Spaces:
Runtime error
Runtime error
Update event.py
Browse files
event.py
CHANGED
|
@@ -10,15 +10,20 @@ from datetime import datetime, timezone
|
|
| 10 |
import hashlib
|
| 11 |
import re
|
| 12 |
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
|
|
|
|
|
|
| 19 |
|
| 20 |
def validate_component_id(component: str) -> Tuple[bool, str]:
|
| 21 |
-
"""
|
|
|
|
|
|
|
|
|
|
| 22 |
if not isinstance(component, str):
|
| 23 |
return False, "Component ID must be a string"
|
| 24 |
if not (1 <= len(component) <= 255):
|
|
|
|
| 10 |
import hashlib
|
| 11 |
import re
|
| 12 |
|
| 13 |
+
# Note: The following constants are not used directly in this file,
|
| 14 |
+
# but they are kept for potential future extensions or consistency with other modules.
|
| 15 |
+
# from agentic_reliability_framework.core.config.constants import (
|
| 16 |
+
# LATENCY_WARNING, LATENCY_CRITICAL, LATENCY_EXTREME,
|
| 17 |
+
# ERROR_RATE_WARNING, ERROR_RATE_HIGH, ERROR_RATE_CRITICAL,
|
| 18 |
+
# CPU_WARNING, CPU_CRITICAL,
|
| 19 |
+
# MEMORY_WARNING, MEMORY_CRITICAL
|
| 20 |
+
# )
|
| 21 |
|
| 22 |
def validate_component_id(component: str) -> Tuple[bool, str]:
|
| 23 |
+
"""
|
| 24 |
+
Validate component ID format (alphanumeric and hyphens only).
|
| 25 |
+
Returns (is_valid, error_message).
|
| 26 |
+
"""
|
| 27 |
if not isinstance(component, str):
|
| 28 |
return False, "Component ID must be a string"
|
| 29 |
if not (1 <= len(component) <= 255):
|