IdleReturnPrompt
Ask a user who comes back to a long conversation whether to continue it or start fresh: Welcome back, 3h since your last message. This chat already holds 182k tokens. Keep going here or start fresh?. Continue is always shown; New chat with this message and Stop asking render only when their callbacks are set. All strings can be replaced through labels. Without tokens the message omits the size. Your app decides when to show it, for example after an idle period when the conversation is large. Place it above the composer, for example through AgentChat statusBar. Actions wrap below the text in narrow containers. Related helper: formatAwayDuration (45m, 3h, 2d).
Getting Started
$pnpm add @sinups/ai-kit @mantine/core @mantine/hooks @tabler/icons-reactExamples
Wide
Narrow
API reference
Prop
Type
Required
awayMs
number
Yes
How long the user was away, in milliseconds
tokens
number
No
Size of the conversation in tokens
onContinue
() => void
Yes
Keeps working in this conversation
onNewChat
() => void
No
Starts a new chat carrying over the drafted message, the button is rendered only when set
onDontAskAgain
() => void
No
Turns the prompt off, the button is rendered only when set
labels
Partial<IdleReturnPromptLabels>
No
Overrides of the default English labels
className
string
No
Class name added to the root element
style
React.CSSProperties
No
Inline styles added to the root element