Spaces:
Running
Running
Update backend/agents/coordinator_agent.py
Browse files
backend/agents/coordinator_agent.py
CHANGED
|
@@ -80,7 +80,7 @@ class CoordinatorAgent:
|
|
| 80 |
|
| 81 |
self._groq_client = Groq(api_key=groq_api_key)
|
| 82 |
self._active_backend = 'groq'
|
| 83 |
-
self._active_model = '
|
| 84 |
|
| 85 |
print(f'π§ [CoordinatorAgent] Ready β backend=groq model={self._active_model} | ReAct loop')
|
| 86 |
|
|
@@ -119,16 +119,13 @@ class CoordinatorAgent:
|
|
| 119 |
plan['confidence_score'] = 0.5
|
| 120 |
|
| 121 |
# GR-C4: Consistency β threat_level must match risk_score thresholds
|
| 122 |
-
# risk
|
| 123 |
-
#
|
| 124 |
-
# risk
|
| 125 |
-
expected = 'HIGH' if risk_score >
|
| 126 |
tl_current = plan['threat_level']
|
| 127 |
-
if
|
| 128 |
-
issues.append(f'
|
| 129 |
-
plan['threat_level'] = expected
|
| 130 |
-
elif expected == 'MEDIUM' and tl_current in ('HIGH', 'CRITICAL'):
|
| 131 |
-
issues.append(f'GR_C4_threat_downgraded:{tl_current}->{expected}')
|
| 132 |
plan['threat_level'] = expected
|
| 133 |
|
| 134 |
# GR-C5: Arabic alert fallback
|
|
|
|
| 80 |
|
| 81 |
self._groq_client = Groq(api_key=groq_api_key)
|
| 82 |
self._active_backend = 'groq'
|
| 83 |
+
self._active_model = 'llama-3.3-70b-versatile'
|
| 84 |
|
| 85 |
print(f'π§ [CoordinatorAgent] Ready β backend=groq model={self._active_model} | ReAct loop')
|
| 86 |
|
|
|
|
| 119 |
plan['confidence_score'] = 0.5
|
| 120 |
|
| 121 |
# GR-C4: Consistency β threat_level must match risk_score thresholds
|
| 122 |
+
# risk > 0.80 (density_pct > 80%) β HIGH
|
| 123 |
+
# risk > 0.20 (density_pct > 20%) β MEDIUM
|
| 124 |
+
# risk <= 0.20 (density_pct <= 20%) β LOW
|
| 125 |
+
expected = 'HIGH' if risk_score > 0.80 else 'MEDIUM' if risk_score > 0.20 else 'LOW'
|
| 126 |
tl_current = plan['threat_level']
|
| 127 |
+
if tl_current != expected:
|
| 128 |
+
issues.append(f'GR_C4_threat_corrected:{tl_current}->{expected}')
|
|
|
|
|
|
|
|
|
|
| 129 |
plan['threat_level'] = expected
|
| 130 |
|
| 131 |
# GR-C5: Arabic alert fallback
|