mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-11 03:38:38 +00:00
refactor(types): annotate GenerateRequestBase containers and check_max_budget (#45801)
Part of LIT-9423
This commit is contained in:
parent
dec8ec5daa
commit
b7d48ecd28
1 changed files with 10 additions and 10 deletions
|
|
@ -1183,40 +1183,40 @@ class GenerateRequestBase(LiteLLMPydanticObjectBase):
|
|||
|
||||
key_alias: str | None = None
|
||||
duration: str | None = None
|
||||
models: list | None = []
|
||||
models: list[Any] | None = []
|
||||
spend: float | None = 0
|
||||
max_budget: float | None = None
|
||||
user_id: str | None = None
|
||||
team_id: str | None = None
|
||||
agent_id: str | None = None
|
||||
max_parallel_requests: int | None = None
|
||||
metadata: dict | None = {}
|
||||
metadata: dict[Any, Any] | None = {}
|
||||
tpm_limit: int | None = None
|
||||
rpm_limit: int | None = None
|
||||
|
||||
budget_duration: str | None = None
|
||||
budget_limits: list[BudgetLimitEntry] | None = None # multiple concurrent budget windows
|
||||
allowed_cache_controls: list | None = []
|
||||
config: dict | None = {}
|
||||
permissions: dict | None = {}
|
||||
model_max_budget: dict | None = {} # {"gpt-4": 5.0, "gpt-3.5-turbo": 5.0}, defaults to {}
|
||||
allowed_cache_controls: list[object] | None = []
|
||||
config: dict[object, object] | None = {}
|
||||
permissions: dict[object, object] | None = {}
|
||||
model_max_budget: dict[object, object] | None = {} # {"gpt-4": 5.0, "gpt-3.5-turbo": 5.0}, defaults to {}
|
||||
budget_fallbacks: dict[str, list[str]] | None = None
|
||||
|
||||
model_config = ConfigDict(protected_namespaces=())
|
||||
model_rpm_limit: dict | None = None
|
||||
model_tpm_limit: dict | None = None
|
||||
model_rpm_limit: dict[object, object] | None = None
|
||||
model_tpm_limit: dict[object, object] | None = None
|
||||
mcp_rpm_limit: dict[str, int] | None = None
|
||||
tag_rpm_limit: dict[str, int] | None = None
|
||||
guardrails: list[str] | None = None
|
||||
policies: list[str] | None = None
|
||||
prompts: list[str] | None = None
|
||||
blocked: bool | None = None
|
||||
aliases: dict | None = {}
|
||||
aliases: dict[object, object] | None = {}
|
||||
object_permission: LiteLLM_ObjectPermissionBase | None = None
|
||||
|
||||
@field_validator("max_budget", mode="before")
|
||||
@classmethod
|
||||
def check_max_budget(cls, v):
|
||||
def check_max_budget(cls, v: object) -> object:
|
||||
if v == "":
|
||||
return None
|
||||
return v
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue