Components / AI Agents

AI Function Call Display

A function call visualization showing AI-generated function invocations with parameters and return values.

Live Preview — ai-function-call-01
Tool Invocations
CALLING: global_search
{
  "query": "AAPL historical revenue Q3",
  "limit": 5,
  "depth": "thorough"
}
RESPONSE: 200 OK

"Found 4 relevant records. Total revenue for Q3 2024 reported at $94.9B, up 6% YoY..."


Installation

Dependencies

Install the core libraries required for this component.

npm
npm install react lucide-react

Source Code

ai-function-call-01.tsx
"use client";

import React from "react";
import { Code2, Hash, Terminal } from "lucide-react";

export default function AIFunctionCall() {
    return (
        <div className="rounded-xl border border-zinc-200 dark:border-zinc-800 bg-white dark:bg-zinc-950 shadow-sm w-full max-w-xl mx-auto overflow-hidden">
            <div className="flex items-center gap-2 px-4 py-3 bg-zinc-50 dark:bg-zinc-900 border-b border-zinc-200 dark:border-zinc-800">
                <Code2 className="h-4 w-4 text-blue-500" />
                <span className="text-xs font-bold text-zinc-900 dark:text-zinc-100">Tool Invocations</span>
            </div>

            <div className="p-4 space-y-4 font-mono text-xs">
                <div className="space-y-2">
                    <div className="flex items-center gap-2 text-zinc-400">
                        <Terminal className="h-3 w-3" />
                        <span>CALLING: global_search</span>
                    </div>
                    <div className="p-3 rounded-lg bg-zinc-950 text-blue-400 border border-zinc-800">
                        <pre>
                            <code>{`{
  "query": "AAPL historical revenue Q3",
  "limit": 5,
  "depth": "thorough"
}`}</code>
                        </pre>
                    </div>
                </div>

                <div className="space-y-2">
                    <div className="flex items-center gap-2 text-emerald-500">
                        <Hash className="h-3 w-3" />
                        <span>RESPONSE: 200 OK</span>
                    </div>
                    <div className="p-3 rounded-lg bg-emerald-500/5 text-emerald-600 dark:text-emerald-400 border border-emerald-500/20">
                        <p>"Found 4 relevant records. Total revenue for Q3 2024 reported at $94.9B, up 6% YoY..."</p>
                    </div>
                </div>
            </div>
        </div>
    );
}

Functional Logic

Internal functions used to handle component logic.

Function Parameters
AIFunctionCall() None

JSX Tags Usage

Every JSX/HTML tag used in this component, with usage count and source.

Tag Count Type Source
<Code2> Library lucide-react
<Hash> Library lucide-react
<Terminal> Library lucide-react
<code> Native Native HTML
<div> Native Native HTML
<p> Native Native HTML
<pre> Native Native HTML
<span> Native Native HTML

Related Components

  • AI Agent Card — A card displaying an AI agent's profile with capabilities, status indicator, and quick-action buttons.
  • AI Agent Workflow — A step-by-step workflow visualization showing AI agent task execution with progress and status updates.
  • AI Tool Selector — A tool selection interface for configuring AI agent capabilities with toggle switches and descriptions.
  • AI Agent Execution Log — A detailed execution log showing AI agent reasoning steps, tool calls, and decision traces.
  • AI Agent Memory Panel — A memory management panel showing stored context, conversation history, and knowledge base entries.
  • AI Task Queue — A priority task queue showing pending, active, and completed AI agent tasks with progress indicators.