mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-06 02:48:13 +00:00
(fix) check size of data to predict
This commit is contained in:
parent
e62e83c42a
commit
15b5cb1612
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
Reference in a new issue