Repository navigation
feat(proxy): type Customer Management response_model for OpenAPI coverage #31043
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 5 commits
d857b1c
f6eb184
fc41235
38e6d11
490000e
8af41f5
8bd32d7
e5660c1
df01ad6
99f17cb
0ab1e8b
99c7ca7
159a29f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| from typing import List, Optional | ||
|
|
||
| from pydantic import BaseModel, Field | ||
|
|
||
| from litellm.models.budget import LiteLLM_BudgetTableFull | ||
| from litellm.models.end_user import LiteLLM_EndUserTable | ||
|
|
||
|
|
||
| class CustomerResponse(LiteLLM_EndUserTable): | ||
| """Customer object returned by the /customer read+write endpoints. | ||
|
|
||
| Nests the full budget response model so server-managed budget fields | ||
| (budget_reset_at, created_at) survive response_model filtering, rather than | ||
| the narrow write-allowlist shape LiteLLM_EndUserTable carries for internal use. | ||
| """ | ||
|
|
||
| litellm_budget_table: Optional[LiteLLM_BudgetTableFull] = None # pyright: ignore | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
ArtifactsRepro: focused mapper and endpoint harness source
Repro: direct validation error and HTTP 500 Internal Server Error output
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Greptile's repro fabricates a budget object with no created_at and feeds it straight to the internal mapper, but no real /customer/* request can reach that state since the budget is always None or a DB row whose created_at is NOT NULL DEFAULT now()
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fair point — |
||
|
|
||
|
|
||
| class BlockUsersResponse(BaseModel): | ||
| blocked_users: List[LiteLLM_EndUserTable] | ||
|
|
||
|
|
||
| class UnblockUsersResponse(BaseModel): | ||
| blocked_users: List[str] = Field( | ||
| description="User IDs that remain blocked after this unblock call" | ||
| ) | ||
|
|
||
|
greptile-apps[bot] marked this conversation as resolved.
Resolved
|
||
|
|
||
| class DeleteCustomersResponse(BaseModel): | ||
| deleted_customers: int | ||
| message: str | ||
Uh oh!
There was an error while loading. Please reload this page.