mirror of
https://github.com/BerriAI/litellm.git
synced 2026-11-16 09:22:22 +00:00
fix(admin-mcp): restore the budget route operation ids the connector pins (#51959)
* fix(admin-mcp): restore the budget route operation ids the connector pins * test(admin-mcp): skip the operation id check below Python 3.12 like its siblings Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> --------- Co-authored-by: devin-ai-integration[bot] <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This commit is contained in:
parent
765af9ab71
commit
b168ca7ae4
3 changed files with 29 additions and 6 deletions
|
|
@ -278,7 +278,12 @@ async def update_budget(
|
|||
return response
|
||||
|
||||
|
||||
@router.post("/budget/new", tags=["budget management"], description=new_budget.__doc__)
|
||||
@router.post(
|
||||
"/budget/new",
|
||||
tags=["budget management"],
|
||||
description=new_budget.__doc__,
|
||||
operation_id="new_budget_budget_new_post",
|
||||
)
|
||||
async def new_budget_endpoint(
|
||||
budget_obj: BudgetWriteRequest,
|
||||
user_api_key_dict: Annotated[UserAPIKeyAuth, Depends(user_api_key_auth)],
|
||||
|
|
@ -286,7 +291,12 @@ async def new_budget_endpoint(
|
|||
return await new_budget(budget_obj, user_api_key_dict)
|
||||
|
||||
|
||||
@router.post("/budget/update", tags=["budget management"], description=update_budget.__doc__)
|
||||
@router.post(
|
||||
"/budget/update",
|
||||
tags=["budget management"],
|
||||
description=update_budget.__doc__,
|
||||
operation_id="update_budget_budget_update_post",
|
||||
)
|
||||
async def update_budget_endpoint(
|
||||
budget_obj: BudgetWriteRequest,
|
||||
user_api_key_dict: Annotated[UserAPIKeyAuth, Depends(user_api_key_auth)],
|
||||
|
|
|
|||
8
litellm/ui/litellm-dashboard/src/lib/http/schema.d.ts
generated
vendored
8
litellm/ui/litellm-dashboard/src/lib/http/schema.d.ts
generated
vendored
|
|
@ -2205,7 +2205,7 @@ export interface paths {
|
|||
* - model_rpm_limit: Optional[dict] - Max requests per minute per model, shared by everything on this budget. Example: {"gpt-4o": 200}
|
||||
* - budget_reset_at: Optional[datetime] - Datetime when the initial budget is reset. Default is now.
|
||||
*/
|
||||
post: operations["new_budget_endpoint_budget_new_post"];
|
||||
post: operations["new_budget_budget_new_post"];
|
||||
delete?: never;
|
||||
options?: never;
|
||||
head?: never;
|
||||
|
|
@ -2265,7 +2265,7 @@ export interface paths {
|
|||
* - model_rpm_limit: Optional[dict] - Max requests per minute per model, shared by everything on this budget. Example: {"gpt-4o": 200}
|
||||
* - budget_reset_at: Optional[datetime] - Update the Datetime when the budget was last reset.
|
||||
*/
|
||||
post: operations["update_budget_endpoint_budget_update_post"];
|
||||
post: operations["update_budget_budget_update_post"];
|
||||
delete?: never;
|
||||
options?: never;
|
||||
head?: never;
|
||||
|
|
@ -58521,7 +58521,7 @@ export interface operations {
|
|||
};
|
||||
};
|
||||
};
|
||||
new_budget_endpoint_budget_new_post: {
|
||||
new_budget_budget_new_post: {
|
||||
parameters: {
|
||||
query?: never;
|
||||
header?: never;
|
||||
|
|
@ -58585,7 +58585,7 @@ export interface operations {
|
|||
};
|
||||
};
|
||||
};
|
||||
update_budget_endpoint_budget_update_post: {
|
||||
update_budget_budget_update_post: {
|
||||
parameters: {
|
||||
query?: never;
|
||||
header?: never;
|
||||
|
|
|
|||
|
|
@ -741,3 +741,16 @@ async def test_user_info_explains_missing_admin_mcp_dependency(
|
|||
mcp_path=None,
|
||||
)
|
||||
assert exc.value.code == "503"
|
||||
|
||||
|
||||
@pytest.mark.skipif(sys.version_info < (3, 12), reason="Admin MCP requires Python 3.12+")
|
||||
def test_gateway_serves_every_operation_id_the_connector_pins() -> None:
|
||||
from litellm_admin_mcp.catalog import OPERATIONS
|
||||
|
||||
paths: Final = proxy_server.app.openapi()["paths"]
|
||||
served: Final = {
|
||||
operation.name: paths.get(operation.path, {}).get(operation.method.lower(), {}).get("operationId")
|
||||
for operation in OPERATIONS
|
||||
}
|
||||
|
||||
assert served == {operation.name: operation.operation_id for operation in OPERATIONS}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue