returns None if it fails
Browse files
App/Chat/PoeChatrouter.py
CHANGED
@@ -58,7 +58,7 @@ async def fetch_predictions(data):
|
|
58 |
if response.status == 403:
|
59 |
continue
|
60 |
proxy = str(p)
|
61 |
-
return await response.json()
|
62 |
except Exception as e:
|
63 |
print("Error fetching", e)
|
64 |
pass
|
@@ -82,8 +82,8 @@ async def get_predictions(input_data: InputData):
|
|
82 |
"version": input_data.version,
|
83 |
}
|
84 |
try:
|
85 |
-
predictions
|
86 |
-
return predictions
|
87 |
except Exception as e:
|
88 |
raise HTTPException(status_code=500, detail=f"Internal Server Error: {str(e)}")
|
89 |
|
|
|
58 |
if response.status == 403:
|
59 |
continue
|
60 |
proxy = str(p)
|
61 |
+
return await response.json()
|
62 |
except Exception as e:
|
63 |
print("Error fetching", e)
|
64 |
pass
|
|
|
82 |
"version": input_data.version,
|
83 |
}
|
84 |
try:
|
85 |
+
predictions = await fetch_predictions(data)
|
86 |
+
return predictions
|
87 |
except Exception as e:
|
88 |
raise HTTPException(status_code=500, detail=f"Internal Server Error: {str(e)}")
|
89 |
|