-
Notifications
You must be signed in to change notification settings - Fork 71
Expand file tree
/
Copy pathtoolcall-prepare.tsx
More file actions
36 lines (34 loc) · 970 Bytes
/
toolcall-prepare.tsx
File metadata and controls
36 lines (34 loc) · 970 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
import { cn } from "@heroui/react";
import { LoadingIndicator } from "../loading-indicator";
export const ToolCallPrepareMessageContainer = ({
functionName,
stale,
preparing,
}: {
functionName: string;
stale: boolean;
preparing: boolean;
}) => {
// When preparing, show minimal UI with just the text
if (preparing && !stale) {
return (
<div className="chat-message-entry">
<span
className="text-xs pl-2 text-gray-400 shimmer">
Preparing function {functionName}...
</span>
</div>
);
}
// When prepared or stale, show the full indicator
return (
<div className="chat-message-entry">
<div className={cn("indicator", stale ? "preparing" : "prepared")}>
<LoadingIndicator
text={`Preparing function ${functionName}...`}
errorMessage={stale ? "Prepare function failed, please reload this conversation." : undefined}
/>
</div>
</div>
);
};