mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-27 03:34:10 +00:00
(fix) check size of data to predict
This commit is contained in:
parent
a7a62fa51a
commit
c4090a8e17
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