llama-stack-mirror/llama_stack/ui/components/responses/items/function-call-item.tsx
Francisco Javier Arceo 94414910f1 finish moving chat -> chat-playground / ui and updating the prompts
Signed-off-by: Francisco Javier Arceo <farceo@redhat.com>
2025-07-30 21:18:22 -04:00

29 lines
669 B
TypeScript

import {
MessageBlock,
ToolCallBlock,
} from "@/components/chat-playground/message-components";
import { FunctionCallItem } from "../utils/item-types";
interface FunctionCallItemProps {
item: FunctionCallItem;
index: number;
keyPrefix: string;
}
export function FunctionCallItemComponent({
item,
index,
keyPrefix,
}: FunctionCallItemProps) {
const name = item.name || "unknown";
const args = item.arguments || "{}";
const formattedFunctionCall = `${name}(${args})`;
return (
<MessageBlock
key={`${keyPrefix}-${index}`}
label="Function Call"
content={<ToolCallBlock>{formattedFunctionCall}</ToolCallBlock>}
/>
);
}