Spaces:
Sleeping
Sleeping
Yan-Bo Chen Copilot commited on
Commit ·
c5edc14
1
Parent(s): f29be38
Update tests/test_multilevel_fallback_validation.py
Browse filesCo-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
tests/test_multilevel_fallback_validation.py
CHANGED
|
@@ -292,7 +292,23 @@ class MultilevelFallbackTest:
|
|
| 292 |
return result
|
| 293 |
|
| 294 |
def _detect_fallback_level(self, condition_result: Dict[str, Any]) -> int:
|
| 295 |
-
"""
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 296 |
if not condition_result:
|
| 297 |
return 0 # No result
|
| 298 |
|
|
|
|
| 292 |
return result
|
| 293 |
|
| 294 |
def _detect_fallback_level(self, condition_result: Dict[str, Any]) -> int:
|
| 295 |
+
"""
|
| 296 |
+
Detect which fallback level was used based on the condition result.
|
| 297 |
+
|
| 298 |
+
Fallback levels:
|
| 299 |
+
0: No result or unknown fallback level.
|
| 300 |
+
1: Predefined Mapping (Fast Path) - The condition matches a predefined mapping.
|
| 301 |
+
2: Llama3-Med42-70B Extraction - The condition is extracted by the LLM.
|
| 302 |
+
3: Semantic Search Fallback - The result includes a semantic confidence score.
|
| 303 |
+
4: Medical Query Validation - The query is deemed invalid (e.g., 'invalid_query').
|
| 304 |
+
5: Generic Medical Search - The condition is identified as a generic medical query.
|
| 305 |
+
|
| 306 |
+
Args:
|
| 307 |
+
condition_result (Dict[str, Any]): The result of the condition extraction process.
|
| 308 |
+
|
| 309 |
+
Returns:
|
| 310 |
+
int: The detected fallback level (0-5).
|
| 311 |
+
"""
|
| 312 |
if not condition_result:
|
| 313 |
return 0 # No result
|
| 314 |
|