diff --git a/web-app/src/containers/dialogs/OutOfContextDialog.tsx b/web-app/src/containers/dialogs/OutOfContextDialog.tsx index fb01d7907..92e72950a 100644 --- a/web-app/src/containers/dialogs/OutOfContextDialog.tsx +++ b/web-app/src/containers/dialogs/OutOfContextDialog.tsx @@ -14,7 +14,9 @@ import { Button } from '@/components/ui/button' export function useOutOfContextPromiseModal() { const [isOpen, setIsOpen] = useState(false) const [modalProps, setModalProps] = useState<{ - resolveRef: ((value: unknown) => void) | null + resolveRef: + | ((value: 'ctx_len' | 'context_shift' | undefined) => void) + | null }>({ resolveRef: null, }) @@ -33,17 +35,23 @@ export function useOutOfContextPromiseModal() { return null } - const handleConfirm = () => { + const handleContextLength = () => { setIsOpen(false) if (modalProps.resolveRef) { - modalProps.resolveRef(true) + modalProps.resolveRef('ctx_len') } } + const handleContextShift = () => { + setIsOpen(false) + if (modalProps.resolveRef) { + modalProps.resolveRef('context_shift') + } + } const handleCancel = () => { setIsOpen(false) if (modalProps.resolveRef) { - modalProps.resolveRef(false) + modalProps.resolveRef(undefined) } } @@ -64,7 +72,7 @@ export function useOutOfContextPromiseModal() { {t( 'outOfContextError.description', - 'This chat is reaching the AI’s memory limit, like a whiteboard filling up. We can expand the memory window (called context size) so it remembers more, but it may use more of your computer’s memory.' + 'This chat is reaching the AI’s memory limit, like a whiteboard filling up. We can expand the memory window (called context size) so it remembers more, but it may use more of your computer’s memory. We can also truncate the input, which means it will forget some of the chat history to make room for new messages.' )}

@@ -77,14 +85,17 @@ export function useOutOfContextPromiseModal() {