Spaces:
Running
Running
Update main.py
Browse files
main.py
CHANGED
|
@@ -712,6 +712,8 @@ async def llm_extract_cycle_data(text: str) -> dict:
|
|
| 712 |
|
| 713 |
|
| 714 |
async def llm_verify_disease(symptoms: list, candidates: list) -> dict:
|
|
|
|
|
|
|
| 715 |
content = json.dumps({
|
| 716 |
"confirmed_symptoms": [s.replace("_", " ") for s in symptoms],
|
| 717 |
"candidates": [{"rank": i+1, "disease": n, "score": f"{s:.3f}"}
|
|
|
|
| 712 |
|
| 713 |
|
| 714 |
async def llm_verify_disease(symptoms: list, candidates: list) -> dict:
|
| 715 |
+
if not candidates:
|
| 716 |
+
return {"final_condition": "", "reasoning": "", "confidence": "low"}
|
| 717 |
content = json.dumps({
|
| 718 |
"confirmed_symptoms": [s.replace("_", " ") for s in symptoms],
|
| 719 |
"candidates": [{"rank": i+1, "disease": n, "score": f"{s:.3f}"}
|