mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-26 11:14:04 +00:00
ui mcp tools
This commit is contained in:
parent
f2885bfb65
commit
09e073d57b
1 changed files with 11 additions and 8 deletions
|
@ -1,6 +1,7 @@
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import { ColumnDef } from "@tanstack/react-table";
|
import { ColumnDef } from "@tanstack/react-table";
|
||||||
import { MCPTool, InputSchema } from "./types";
|
import { MCPTool, InputSchema } from "./types";
|
||||||
|
import { Button } from "@tremor/react"
|
||||||
|
|
||||||
export const columns: ColumnDef<MCPTool>[] = [
|
export const columns: ColumnDef<MCPTool>[] = [
|
||||||
{
|
{
|
||||||
|
@ -56,16 +57,18 @@ export const columns: ColumnDef<MCPTool>[] = [
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="flex items-center space-x-2">
|
<div className="flex items-center space-x-2">
|
||||||
<button
|
<Button
|
||||||
|
size="xs"
|
||||||
|
variant="light"
|
||||||
|
className="font-mono text-blue-500 bg-blue-50 hover:bg-blue-100 text-xs font-normal px-2 py-0.5 text-left overflow-hidden truncate max-w-[200px]"
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
if (typeof row.original.onToolSelect === 'function') {
|
if (typeof row.original.onToolSelect === 'function') {
|
||||||
row.original.onToolSelect(tool);
|
row.original.onToolSelect(tool);
|
||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
className="px-3 py-1 text-xs rounded-md bg-blue-600 text-white hover:bg-blue-700"
|
|
||||||
>
|
>
|
||||||
Test Tool
|
Test Tool
|
||||||
</button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
@ -220,13 +223,13 @@ export function ToolTestPanel({
|
||||||
)}
|
)}
|
||||||
|
|
||||||
<div className="mt-6">
|
<div className="mt-6">
|
||||||
<button
|
<Button
|
||||||
type="submit"
|
type="submit"
|
||||||
disabled={isLoading}
|
disabled={isLoading}
|
||||||
className="w-full px-4 py-2 border border-transparent rounded-md shadow-sm text-sm font-medium text-white bg-blue-600 hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 disabled:opacity-50"
|
className="w-full px-4 py-2 border border-transparent rounded-md shadow-sm text-sm font-medium text-white"
|
||||||
>
|
>
|
||||||
{isLoading ? "Calling..." : "Call Tool"}
|
{isLoading ? "Calling..." : "Call Tool"}
|
||||||
</button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue