llama-stack-mirror/llama_stack/ui/components/responses/items/function-call-item.tsx
Eric Huang de53390c1c responses table, responses details
# What does this PR do?


## Test Plan
# What does this PR do?


## Test Plan
2025-05-27 21:23:11 -07:00

29 lines
656 B
TypeScript

import {
MessageBlock,
ToolCallBlock,
} from "@/components/ui/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>}
/>
);
}