Mbonea commited on
Commit
263c778
·
1 Parent(s): ab1d89e

returns None if it fails

Browse files
Files changed (1) hide show
  1. App/Chat/PoeChatrouter.py +3 -3
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(), response.status
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, status_code = await fetch_predictions(data)
86
- return predictions, status_code
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