mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-07 02:59:05 +00:00
fix(ui): use antd Select for MCP ToolTestPanel bool inputs
This commit is contained in:
parent
72a461ba4a
commit
35559c4d60
2 changed files with 9 additions and 9 deletions
|
|
@ -89,7 +89,7 @@ describe("ToolTestPanel defaults", () => {
|
|||
expect(screen.getByLabelText("message")).toHaveValue("");
|
||||
expect(screen.getByLabelText("attempts")).toHaveValue(0);
|
||||
expect(screen.getByLabelText("ratio")).toHaveValue(0.4);
|
||||
expect(screen.getByDisplayValue("True")).toBeInTheDocument();
|
||||
expect(screen.getByTitle("True")).toBeInTheDocument();
|
||||
|
||||
const keywordsTextarea = screen.getByTestId("textarea-keywords");
|
||||
expect(JSON.parse(keywordsTextarea.value)).toEqual([""]);
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import React from "react";
|
||||
import { Button, TextInput } from "@tremor/react";
|
||||
import { MCPTool, InputSchema, InputSchemaProperty } from "./types";
|
||||
import { Form, Tooltip } from "antd";
|
||||
import { Form, Select, Tooltip } from "antd";
|
||||
import { InfoCircleOutlined } from "@ant-design/icons";
|
||||
import NotificationsManager from "../molecules/notifications_manager";
|
||||
|
||||
|
|
@ -480,14 +480,14 @@ export function ToolTestPanel({
|
|||
)}
|
||||
|
||||
{prop.type === "boolean" && (
|
||||
<select
|
||||
className="w-full px-3 py-2 border border-gray-300 rounded-lg shadow-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500 text-sm transition-colors"
|
||||
defaultValue={(initialValue ?? false).toString()}
|
||||
<Select
|
||||
placeholder={`Select ${key}`}
|
||||
allowClear={!actualSchema.required?.includes(key)}
|
||||
className="w-full"
|
||||
>
|
||||
{!actualSchema.required?.includes(key) && <option value="">Select {key}</option>}
|
||||
<option value="true">True</option>
|
||||
<option value="false">False</option>
|
||||
</select>
|
||||
<Select.Option value={true}>True</Select.Option>
|
||||
<Select.Option value={false}>False</Select.Option>
|
||||
</Select>
|
||||
)}
|
||||
|
||||
{(prop.type === "object" || prop.type === "array") && (
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue