mirror of
https://github.com/tiennm99/litellm.git
synced 2026-08-18 14:23:37 +00:00
Merge pull request #14545 from BerriAI/litellm_ui_qa_09_13_2025_p1
Litellm UI qa 09 13 2025 p1 - fix end user filtering + fix load mcp tool call error + prevent setting max user budget on scroll in edit user settings
This commit is contained in:
@@ -10,7 +10,6 @@ from fastapi import APIRouter, Depends, HTTPException, status
|
||||
|
||||
import litellm
|
||||
from litellm._logging import verbose_proxy_logger
|
||||
from litellm.router_strategy.budget_limiter import RouterBudgetLimiting
|
||||
from litellm.proxy._types import *
|
||||
from litellm.proxy._types import ProviderBudgetResponse, ProviderBudgetResponseObject
|
||||
from litellm.proxy.auth.user_api_key_auth import user_api_key_auth
|
||||
@@ -18,6 +17,7 @@ from litellm.proxy.spend_tracking.spend_tracking_utils import (
|
||||
get_spend_by_team_and_customer,
|
||||
)
|
||||
from litellm.proxy.utils import handle_exception_on_proxy
|
||||
from litellm.router_strategy.budget_limiter import RouterBudgetLimiting
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from litellm.proxy.proxy_server import PrismaClient
|
||||
@@ -1663,6 +1663,9 @@ async def ui_view_spend_logs( # noqa: PLR0915
|
||||
key_alias: Optional[str] = fastapi.Query(
|
||||
default=None, description="Filter logs by key alias"
|
||||
),
|
||||
end_user: Optional[str] = fastapi.Query(
|
||||
default=None, description="Filter logs by end user"
|
||||
),
|
||||
):
|
||||
"""
|
||||
View spend logs for UI with pagination support
|
||||
@@ -1730,13 +1733,16 @@ async def ui_view_spend_logs( # noqa: PLR0915
|
||||
|
||||
if model is not None:
|
||||
where_conditions["model"] = model
|
||||
|
||||
|
||||
if key_alias is not None:
|
||||
where_conditions["metadata"] = {
|
||||
"path": ["user_api_key_alias"],
|
||||
"string_contains": key_alias
|
||||
"string_contains": key_alias,
|
||||
}
|
||||
|
||||
if end_user is not None:
|
||||
where_conditions["end_user"] = end_user
|
||||
|
||||
if min_spend is not None or max_spend is not None:
|
||||
where_conditions["spend"] = {}
|
||||
if min_spend is not None:
|
||||
|
||||
@@ -28,7 +28,6 @@ export async function fetchAvailableMCPTools(
|
||||
return data.tools || [];
|
||||
} catch (error) {
|
||||
console.error("Error fetching MCP tools:", error);
|
||||
NotificationManager.fromBackend("Failed to fetch MCP tools");
|
||||
return [];
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
import React from "react";
|
||||
import { Form, InputNumber, Select, Tooltip } from "antd";
|
||||
import NumericalInput from "./shared/numerical_input";
|
||||
import { TextInput, Textarea, SelectItem } from "@tremor/react";
|
||||
import { Button } from "@tremor/react";
|
||||
import { getModelDisplayName } from "./key_team_helpers/fetch_available_models_team_key";
|
||||
@@ -150,7 +151,7 @@ export function UserEditView({
|
||||
label="Max Budget (USD)"
|
||||
name="max_budget"
|
||||
>
|
||||
<InputNumber
|
||||
<NumericalInput
|
||||
step={0.01}
|
||||
precision={2}
|
||||
style={{ width: "100%" }}
|
||||
|
||||
Reference in New Issue
Block a user