forked from phoenix/litellm-mirror
(fix) check size of data to predict
This commit is contained in:
parent
6c847ad0d7
commit
da20aecb16
1 changed files with 5 additions and 0 deletions
|
@ -251,6 +251,11 @@ def _forecast_daily_cost(data: list):
|
|||
import requests
|
||||
from datetime import datetime, timedelta
|
||||
|
||||
if len(data) == 0:
|
||||
return {
|
||||
"response": [],
|
||||
"predicted_spend": "Current Spend = $0, Predicted = $0",
|
||||
}
|
||||
first_entry = data[0]
|
||||
last_entry = data[-1]
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue