Files
copilotkit--copilotkit/packages/angular/src/lib/components/chat/copilot-chat-reasoning-message-utils.ts
T
2026-07-13 12:58:18 +08:00

10 lines
351 B
TypeScript

export function formatReasoningDuration(seconds: number): string {
if (seconds < 1) return "a few seconds";
if (seconds < 60) return `${Math.round(seconds)} seconds`;
const mins = Math.floor(seconds / 60);
const secs = Math.round(seconds % 60);
if (secs === 0) return `${mins} minute${mins > 1 ? "s" : ""}`;
return `${mins}m ${secs}s`;
}