Skip to content

The fastest, litest AI Gateway. Rust core with Python SDK. Call 100+ LLM APIs in OpenAI (or native) format with cost tracking, guardrails, load balancing, and logging [Bedrock, Azure, OpenAI, Anthropic, OpenAI, VertexAI, vLLM, Nvidia NIM]

fix(ui): show the S3 label when editing the s3_v2 callback

yassin251aeea97d4e
diff --git a/ui/litellm-dashboard/src/components/settings.test.tsx b/ui/litellm-dashboard/src/components/settings.test.tsx
index c24fa00438a..4ba5dd23fd1 100644
--- a/ui/litellm-dashboard/src/components/settings.test.tsx
+++ b/ui/litellm-dashboard/src/components/settings.test.tsx
@@ -393,6 +393,7 @@ describe("Settings", () => {
const promptsOnlySwitch = await screen.findByRole("switch", { name: "Log Prompts Only" });
expect(promptsOnlySwitch).not.toBeChecked();
+ expect(within(screen.getByRole("dialog")).getByRole("combobox", { name: "Callback" })).toHaveValue("S3");
await user.click(promptsOnlySwitch);
await user.click(within(screen.getByRole("dialog")).getByRole("button", { name: "Save Changes" }));
diff --git a/ui/litellm-dashboard/src/components/settings.tsx b/ui/litellm-dashboard/src/components/settings.tsx
index c0daeac3b72..9247f22ec28 100644
--- a/ui/litellm-dashboard/src/components/settings.tsx
+++ b/ui/litellm-dashboard/src/components/settings.tsx
@@ -178,7 +178,7 @@ export const CallbackSelector: React.FC<CallbackSelectorProps> = ({
}) => {
const { control } = useFormContext<CallbackFormValues>();
const inputId = React.useId();
- const selectedConfig = callbackConfigs.find((config) => config.id === selectedCallback) ?? null;
+ const selectedConfig = findCallbackConfig(callbackConfigs, selectedCallback) ?? null;
return (
<Controller
@@ -251,10 +251,10 @@ interface CallbackConfigWithParams {
dynamic_params?: Record<string, DynamicParamConfig>;
}
-const findCallbackConfig = (
- callbackConfigs: readonly CallbackConfigWithParams[],
+const findCallbackConfig = <T extends { id: string }>(
+ callbackConfigs: readonly T[],
callbackName: string | null,
-): CallbackConfigWithParams | undefined => {
+): T | undefined => {
if (!callbackName) {
return undefined;
}