mirror of
https://github.com/BerriAI/litellm.git
synced 2026-11-13 08:52:02 +00:00
fix(alerts): satisfy strict lint for model usage timing
This commit is contained in:
parent
dfaa2f4026
commit
b31479f15c
3 changed files with 4 additions and 3 deletions
|
|
@ -103,7 +103,7 @@ def build_model_usage_transaction(payload: SpendLogsPayload) -> ModelUsageTransa
|
|||
return None
|
||||
model: Final = payload["model"] or "unknown"
|
||||
successful: Final = payload["status"] == "success"
|
||||
duration: Final = payload["request_duration_ms"] if "request_duration_ms" in payload else None
|
||||
duration: Final = payload["request_duration_ms"]
|
||||
return ModelUsageTransaction(
|
||||
key=ModelUsageKey(
|
||||
date=date,
|
||||
|
|
|
|||
|
|
@ -1,11 +1,11 @@
|
|||
import hashlib
|
||||
import json
|
||||
from collections.abc import Sequence
|
||||
from typing import ( # noqa: TID251 # Prisma exposes generated table actions dynamically
|
||||
from typing import (
|
||||
TYPE_CHECKING,
|
||||
Final,
|
||||
Protocol,
|
||||
cast,
|
||||
cast, # noqa: TID251 # Prisma exposes generated table actions dynamically
|
||||
)
|
||||
|
||||
from litellm.models.alert import Alert, AlertDetection, AlertPage, AlertStatus
|
||||
|
|
|
|||
|
|
@ -51,6 +51,7 @@ def _payload(**overrides: Any) -> dict[str, Any]:
|
|||
"request_tags": "[]",
|
||||
"custom_llm_provider": "openai",
|
||||
"status": "success",
|
||||
"request_duration_ms": None,
|
||||
**overrides,
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue