mirror of
https://github.com/BerriAI/litellm.git
synced 2026-11-02 07:13:02 +00:00
fix(guardrails): wrap date filters in to_db_date for usage overview
This commit is contained in:
parent
0cb3fae245
commit
4ee434ad6e
1 changed files with 2 additions and 2 deletions
|
|
@ -279,7 +279,7 @@ async def guardrails_usage_overview(
|
|||
|
||||
# Daily metrics in range
|
||||
metrics = await prisma_client.db.litellm_dailyguardrailmetrics.find_many(
|
||||
where={"date": {"gte": start, "lte": end}}
|
||||
where={"date": {"gte": to_db_date(start), "lte": to_db_date(end)}}
|
||||
)
|
||||
|
||||
# Previous period for trend
|
||||
|
|
@ -287,7 +287,7 @@ async def guardrails_usage_overview(
|
|||
datetime.strptime(start, "%Y-%m-%d") - timedelta(days=7)
|
||||
).strftime("%Y-%m-%d")
|
||||
metrics_prev = await prisma_client.db.litellm_dailyguardrailmetrics.find_many(
|
||||
where={"date": {"gte": start_prev, "lt": start}}
|
||||
where={"date": {"gte": to_db_date(start_prev), "lt": to_db_date(start)}}
|
||||
)
|
||||
|
||||
agg = _aggregate_daily_metrics(metrics, "guardrail_id")
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue