'use client' import { useState } from 'react' import { useRouter } from 'next/navigation' import { AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogTitle, } from '@/components/ui/alert-dialog' import { Button } from '@/components/ui/button' import { AlertTriangle, ExternalLink } from 'lucide-react' interface EmbeddingModelChangeDialogProps { open: boolean onOpenChange: (open: boolean) => void onConfirm: () => void oldModelName?: string newModelName?: string } export function EmbeddingModelChangeDialog({ open, onOpenChange, onConfirm, oldModelName, newModelName }: EmbeddingModelChangeDialogProps) { const router = useRouter() const [isConfirming, setIsConfirming] = useState(false) const handleConfirmAndRebuild = () => { setIsConfirming(true) onConfirm() // Give a moment for the model to update, then redirect setTimeout(() => { router.push('/advanced') onOpenChange(false) setIsConfirming(false) }, 500) } const handleConfirmOnly = () => { onConfirm() onOpenChange(false) } return (
Embedding Model Change

You are about to change your embedding model{' '} {oldModelName && newModelName && ( <> from {oldModelName} to {newModelName} )} .

⚠️ Important: Rebuild Required

Changing your embedding model requires rebuilding all existing embeddings to maintain consistency. Without rebuilding, your searches may return incorrect or incomplete results.

What happens next:

  • Your default embedding model will be updated
  • Existing embeddings will remain unchanged until rebuild
  • New content will use the new embedding model
  • You should rebuild embeddings as soon as possible

Would you like to proceed to the Advanced page to start the rebuild now?

Cancel Change & Go to Rebuild
) }