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]

refactor(ui): replace the agent form's last antd Form.Item with its own field label

Yuneng Jiang78670789a027
diff --git a/ui/litellm-dashboard/src/app/(dashboard)/agents/_components/add_agent_form.test.tsx b/ui/litellm-dashboard/src/app/(dashboard)/agents/_components/add_agent_form.test.tsx
index 767e7c2ae5f..3601bc57fed 100644
--- a/ui/litellm-dashboard/src/app/(dashboard)/agents/_components/add_agent_form.test.tsx
+++ b/ui/litellm-dashboard/src/app/(dashboard)/agents/_components/add_agent_form.test.tsx
@@ -55,6 +55,14 @@ describe("AddAgentForm logos", () => {
expect(selectionLogo).toHaveAttribute("src", expect.stringContaining("assets/logos/a2a_agent.png"));
});
+ it("labels the agent type picker so the label points at the control", async () => {
+ renderForm();
+
+ await screen.findByAltText("A2A Agent logo");
+
+ expect(screen.getByLabelText("Agent Type")).toBe(screen.getByRole("combobox"));
+ });
+
it("renders the option logo when the agent type dropdown is opened", async () => {
renderForm();
diff --git a/ui/litellm-dashboard/src/app/(dashboard)/agents/_components/add_agent_form.tsx b/ui/litellm-dashboard/src/app/(dashboard)/agents/_components/add_agent_form.tsx
index da98eb8a352..34f6a879b1e 100644
--- a/ui/litellm-dashboard/src/app/(dashboard)/agents/_components/add_agent_form.tsx
+++ b/ui/litellm-dashboard/src/app/(dashboard)/agents/_components/add_agent_form.tsx
@@ -1,5 +1,5 @@
import React, { useState, useEffect } from "react";
-import { Form, Modal, Select, Steps, Tag } from "antd";
+import { Modal, Select, Steps, Tag } from "antd";
import { FormProvider, useForm, useWatch } from "react-hook-form";
import { toast } from "@/lib/toast";
import { Logo } from "@/components/molecules/logo/Logo";
@@ -679,12 +679,12 @@ const AddAgentForm: React.FC<AddAgentFormProps> = ({ visible, onClose, accessTok
const renderConfigureStep = () => (
<>
- <Form.Item
- label={<span className="text-sm font-medium text-foreground">Agent Type</span>}
- required
- tooltip="Select the type of agent you want to create"
- >
+ <Field className="gap-1">
+ <FieldLabel htmlFor="agent-type">
+ {labelWithHint("Agent Type", "Select the type of agent you want to create")}
+ </FieldLabel>
<Select
+ id="agent-type"
value={agentType}
onChange={handleAgentTypeChange}
size="large"
@@ -744,7 +744,7 @@ const AddAgentForm: React.FC<AddAgentFormProps> = ({ visible, onClose, accessTok
</Select.Option>
))}
</Select>
- </Form.Item>
+ </Field>
<div className="mt-4">
{agentType === CUSTOM_AGENT_TYPE ? (