import { formatDuration } from "@utils/format.ts"; import { Timer, Wrench } from "lucide-react"; import { useState } from "react"; import type { ChatMessageAssistantTool } from "../textGeneration/types.ts"; import { Loader } from "../theme"; import cn from "../utils/classnames.ts"; export default function MessageToolCall({ tool, className = "", }: { tool: ChatMessageAssistantTool; className?: string; }) { const [expanded, setExpanded] = useState(false); const isLoading = tool.result === ""; return (
{expanded && (
Function:
{tool.functionSignature}
Result:
{tool.result || "loading.."}
)}
); }