diff --git a/surfsense_web/app/dashboard/[search_space_id]/client-layout.tsx b/surfsense_web/app/dashboard/[search_space_id]/client-layout.tsx index 759539ce3..7c9fcb1a0 100644 --- a/surfsense_web/app/dashboard/[search_space_id]/client-layout.tsx +++ b/surfsense_web/app/dashboard/[search_space_id]/client-layout.tsx @@ -47,14 +47,9 @@ export function DashboardClientLayout({ const { mutateAsync: updatePreferences } = useAtomValue(updateLLMPreferencesMutationAtom); const isOnboardingComplete = useCallback(() => { - // Check that both LLM IDs are set (including 0 for Auto mode) - return ( - preferences.agent_llm_id !== null && - preferences.agent_llm_id !== undefined && - preferences.document_summary_llm_id !== null && - preferences.document_summary_llm_id !== undefined - ); - }, [preferences]); + // Check that the Agent LLM ID is set, including 0 for Auto mode. + return preferences.agent_llm_id !== null && preferences.agent_llm_id !== undefined; + }, [preferences.agent_llm_id]); const { data: access = null, isLoading: accessLoading } = useAtomValue(myAccessAtom); const [hasCheckedOnboarding, setHasCheckedOnboarding] = useState(false); @@ -100,7 +95,6 @@ export function DashboardClientLayout({ search_space_id: Number(searchSpaceId), data: { agent_llm_id: firstGlobalConfig.id, - document_summary_llm_id: firstGlobalConfig.id, }, }); diff --git a/surfsense_web/app/dashboard/[search_space_id]/onboard/page.tsx b/surfsense_web/app/dashboard/[search_space_id]/onboard/page.tsx index 3e3f41deb..6c1393a23 100644 --- a/surfsense_web/app/dashboard/[search_space_id]/onboard/page.tsx +++ b/surfsense_web/app/dashboard/[search_space_id]/onboard/page.tsx @@ -54,10 +54,7 @@ export default function OnboardPage() { // Check if onboarding is already complete (including 0 for Auto mode) const isOnboardingComplete = - preferences.agent_llm_id !== null && - preferences.agent_llm_id !== undefined && - preferences.document_summary_llm_id !== null && - preferences.document_summary_llm_id !== undefined; + preferences.agent_llm_id !== null && preferences.agent_llm_id !== undefined; useEffect(() => { if (!preferencesLoading && isOnboardingComplete) { @@ -83,7 +80,6 @@ export default function OnboardPage() { search_space_id: searchSpaceId, data: { agent_llm_id: firstGlobalConfig.id, - document_summary_llm_id: firstGlobalConfig.id, }, }); @@ -120,7 +116,6 @@ export default function OnboardPage() { search_space_id: searchSpaceId, data: { agent_llm_id: newConfig.id, - document_summary_llm_id: newConfig.id, }, }); diff --git a/surfsense_web/components/assistant-ui/connector-popup.tsx b/surfsense_web/components/assistant-ui/connector-popup.tsx index 9b76ea4cb..6ea55f4a5 100644 --- a/surfsense_web/components/assistant-ui/connector-popup.tsx +++ b/surfsense_web/components/assistant-ui/connector-popup.tsx @@ -1,18 +1,10 @@ "use client"; import { useAtomValue } from "jotai"; -import { AlertTriangle } from "lucide-react"; -import { useRouter } from "next/navigation"; import { forwardRef, useEffect, useImperativeHandle, useMemo, useState } from "react"; import { createPortal } from "react-dom"; import { statusInboxItemsAtom } from "@/atoms/inbox/status-inbox.atom"; -import { - globalNewLLMConfigsAtom, - llmPreferencesAtom, -} from "@/atoms/new-llm-config/new-llm-config-query.atoms"; import { activeSearchSpaceIdAtom } from "@/atoms/search-spaces/search-space-query.atoms"; -import { Alert, AlertDescription, AlertTitle } from "@/components/ui/alert"; -import { Button } from "@/components/ui/button"; import { Dialog, DialogContent, DialogTitle } from "@/components/ui/dialog"; import { Tabs, TabsContent } from "@/components/ui/tabs"; import type { SearchSourceConnector } from "@/contracts/types/connector.types"; @@ -44,28 +36,7 @@ interface ConnectorIndicatorProps { export const ConnectorIndicator = forwardRef( (_props, ref) => { - const router = useRouter(); const searchSpaceId = useAtomValue(activeSearchSpaceIdAtom); - const { data: preferences = {}, isFetching: preferencesLoading } = - useAtomValue(llmPreferencesAtom); - const { data: globalConfigs = [], isFetching: globalConfigsLoading } = - useAtomValue(globalNewLLMConfigsAtom); - - // Check if document summary LLM is properly configured - // - If ID is 0 (Auto mode), we need global configs to be available - // - If ID is positive (user config) or negative (specific global config), it's configured - // - If ID is null/undefined, it's not configured - const docSummaryLlmId = preferences.document_summary_llm_id; - const isAutoMode = docSummaryLlmId === 0; - const hasGlobalConfigs = globalConfigs.length > 0; - - const hasDocumentSummaryLLM = - docSummaryLlmId !== null && - docSummaryLlmId !== undefined && - // If it's Auto mode, we need global configs to actually be available - (!isAutoMode || hasGlobalConfigs); - - const llmConfigLoading = preferencesLoading || globalConfigsLoading; // Real-time document type counts via Zero (updates instantly as docs are indexed) const documentTypeCounts = useZeroDocumentTypeCounts(searchSpaceId); @@ -97,7 +68,6 @@ export const ConnectorIndicator = forwardRef { startIndexing(editingConnector.id); @@ -339,7 +306,6 @@ export const ConnectorIndicator = forwardRef { @@ -378,35 +343,6 @@ export const ConnectorIndicator = forwardRef
- {/* LLM Configuration Warning */} - {!llmConfigLoading && !hasDocumentSummaryLLM && ( -
- - - LLM Configuration Required - -

- {isAutoMode && !hasGlobalConfigs - ? "Auto mode requires a global LLM configuration. Please add one in Settings" - : "A Document Summary LLM is required to process uploads, configure one in Settings"} -

- -
-
-
- )} - {}} - onConnectNonOAuth={hasDocumentSummaryLLM ? handleConnectNonOAuth : () => {}} - onCreateWebcrawler={ - hasDocumentSummaryLLM ? handleCreateWebcrawler : () => {} - } - onCreateYouTubeCrawler={ - hasDocumentSummaryLLM ? handleCreateYouTubeCrawler : () => {} - } + onConnectOAuth={handleConnectOAuth} + onConnectNonOAuth={handleConnectNonOAuth} + onCreateWebcrawler={handleCreateWebcrawler} + onCreateYouTubeCrawler={handleCreateYouTubeCrawler} onManage={handleStartEdit} onViewAccountsList={handleViewAccountsList} /> diff --git a/surfsense_web/components/assistant-ui/connector-popup/components/summary-config.tsx b/surfsense_web/components/assistant-ui/connector-popup/components/summary-config.tsx deleted file mode 100644 index b9ff69f5f..000000000 --- a/surfsense_web/components/assistant-ui/connector-popup/components/summary-config.tsx +++ /dev/null @@ -1,25 +0,0 @@ -"use client"; - -import type { FC } from "react"; -import { Switch } from "@/components/ui/switch"; - -interface SummaryConfigProps { - enabled: boolean; - onEnabledChange: (enabled: boolean) => void; -} - -export const SummaryConfig: FC = ({ enabled, onEnabledChange }) => { - return ( -
-
-
-

Enable AI Summary

-

- Improves search quality but adds latency during indexing -

-
- -
-
- ); -}; diff --git a/surfsense_web/components/assistant-ui/connector-popup/connector-configs/views/connector-edit-view.tsx b/surfsense_web/components/assistant-ui/connector-popup/connector-configs/views/connector-edit-view.tsx index 2b86daf65..d61460d48 100644 --- a/surfsense_web/components/assistant-ui/connector-popup/connector-configs/views/connector-edit-view.tsx +++ b/surfsense_web/components/assistant-ui/connector-popup/connector-configs/views/connector-edit-view.tsx @@ -17,7 +17,6 @@ import { BACKEND_URL } from "@/lib/env-config"; import { cn } from "@/lib/utils"; import { DateRangeSelector } from "../../components/date-range-selector"; import { PeriodicSyncConfig } from "../../components/periodic-sync-config"; -import { SummaryConfig } from "../../components/summary-config"; import { VisionLLMConfig } from "../../components/vision-llm-config"; import { LIVE_CONNECTOR_TYPES } from "../../constants/connector-constants"; import { getConnectorDisplayName } from "../../tabs/all-connectors-tab"; @@ -38,7 +37,6 @@ interface ConnectorEditViewProps { endDate: Date | undefined; periodicEnabled: boolean; frequencyMinutes: string; - enableSummary: boolean; enableVisionLlm: boolean; isSaving: boolean; isDisconnecting: boolean; @@ -48,7 +46,6 @@ interface ConnectorEditViewProps { onEndDateChange: (date: Date | undefined) => void; onPeriodicEnabledChange: (enabled: boolean) => void; onFrequencyChange: (frequency: string) => void; - onEnableSummaryChange: (enabled: boolean) => void; onEnableVisionLlmChange: (enabled: boolean) => void; onSave: () => void; onDisconnect: () => void; @@ -64,7 +61,6 @@ export const ConnectorEditView: FC = ({ endDate, periodicEnabled, frequencyMinutes, - enableSummary, enableVisionLlm, isSaving, isDisconnecting, @@ -74,7 +70,6 @@ export const ConnectorEditView: FC = ({ onEndDateChange, onPeriodicEnabledChange, onFrequencyChange, - onEnableSummaryChange, onEnableVisionLlmChange, onSave, onDisconnect, @@ -87,9 +82,13 @@ export const ConnectorEditView: FC = ({ const isAuthExpired = connector.config?.auth_expired === true; const reauthEndpoint = getReauthEndpoint(connector); const [reauthing, setReauthing] = useState(false); + const isMCPBacked = Boolean(connector.config?.server_config); + const isLive = isMCPBacked || LIVE_CONNECTOR_TYPES.has(connector.connector_type); const supportsVisionLlm = VISION_LLM_CONNECTOR_TYPES.has(connector.connector_type); - const showsAiToggles = - connector.is_indexable || connector.connector_type === EnumConnectorName.OBSIDIAN_CONNECTOR; + const showsVisionToggle = + !isLive && + supportsVisionLlm && + (connector.is_indexable || connector.connector_type === EnumConnectorName.OBSIDIAN_CONNECTOR); const handleReauth = useCallback(async () => { const spaceId = searchSpaceId ?? searchSpaceIdAtom; @@ -121,9 +120,6 @@ export const ConnectorEditView: FC = ({ } }, [searchSpaceId, searchSpaceIdAtom, reauthEndpoint, connector.id]); - const isMCPBacked = Boolean(connector.config?.server_config); - const isLive = isMCPBacked || LIVE_CONNECTOR_TYPES.has(connector.connector_type); - // Get connector-specific config component (MCP-backed connectors use a generic view) const ConnectorConfigComponent = useMemo(() => { if (isMCPBacked) return MCPServiceConfig; @@ -280,77 +276,64 @@ export const ConnectorEditView: FC = ({ /> )} - {/* Summary + vision toggles (Obsidian is plugin-push, non-indexable by design) */} - {showsAiToggles && !isLive && ( - <> - {/* AI Summary toggle */} - - - {/* Vision LLM toggle for file/attachment connectors */} - {supportsVisionLlm && ( - - )} - - {/* Date-range and periodic sync stay indexable-only */} - {connector.is_indexable && - connector.connector_type !== "GOOGLE_DRIVE_CONNECTOR" && - connector.connector_type !== "COMPOSIO_GOOGLE_DRIVE_CONNECTOR" && - connector.connector_type !== "DROPBOX_CONNECTOR" && - connector.connector_type !== "ONEDRIVE_CONNECTOR" && - connector.connector_type !== "WEBCRAWLER_CONNECTOR" && - connector.connector_type !== "GITHUB_CONNECTOR" && ( - - )} - - {connector.is_indexable && - (() => { - const isGoogleDrive = connector.connector_type === "GOOGLE_DRIVE_CONNECTOR"; - const isComposioGoogleDrive = - connector.connector_type === "COMPOSIO_GOOGLE_DRIVE_CONNECTOR"; - const requiresFolderSelection = isGoogleDrive || isComposioGoogleDrive; - const selectedFolders = - (connector.config?.selected_folders as - | Array<{ id: string; name: string }> - | undefined) || []; - const selectedFiles = - (connector.config?.selected_files as - | Array<{ id: string; name: string }> - | undefined) || []; - const hasItemsSelected = selectedFolders.length > 0 || selectedFiles.length > 0; - const isDisabled = requiresFolderSelection && !hasItemsSelected; - - return ( - - ); - })()} - + {/* Vision toggle (Obsidian is plugin-push, non-indexable by design) */} + {showsVisionToggle && ( + )} + {/* Date-range and periodic sync stay indexable-only */} + {connector.is_indexable && + connector.connector_type !== "GOOGLE_DRIVE_CONNECTOR" && + connector.connector_type !== "COMPOSIO_GOOGLE_DRIVE_CONNECTOR" && + connector.connector_type !== "DROPBOX_CONNECTOR" && + connector.connector_type !== "ONEDRIVE_CONNECTOR" && + connector.connector_type !== "WEBCRAWLER_CONNECTOR" && + connector.connector_type !== "GITHUB_CONNECTOR" && ( + + )} + + {connector.is_indexable && + (() => { + const isGoogleDrive = connector.connector_type === "GOOGLE_DRIVE_CONNECTOR"; + const isComposioGoogleDrive = + connector.connector_type === "COMPOSIO_GOOGLE_DRIVE_CONNECTOR"; + const requiresFolderSelection = isGoogleDrive || isComposioGoogleDrive; + const selectedFolders = + (connector.config?.selected_folders as Array<{ id: string; name: string }> | undefined) || + []; + const selectedFiles = + (connector.config?.selected_files as Array<{ id: string; name: string }> | undefined) || + []; + const hasItemsSelected = selectedFolders.length > 0 || selectedFiles.length > 0; + const isDisabled = requiresFolderSelection && !hasItemsSelected; + + return ( + + ); + })()} + {/* Info box - hidden for live connectors */} {connector.is_indexable && !isLive && ( diff --git a/surfsense_web/components/assistant-ui/connector-popup/connector-configs/views/indexing-configuration-view.tsx b/surfsense_web/components/assistant-ui/connector-popup/connector-configs/views/indexing-configuration-view.tsx index 74b4fad9f..218b3d329 100644 --- a/surfsense_web/components/assistant-ui/connector-popup/connector-configs/views/indexing-configuration-view.tsx +++ b/surfsense_web/components/assistant-ui/connector-popup/connector-configs/views/indexing-configuration-view.tsx @@ -11,7 +11,6 @@ import { getConnectorTypeDisplay } from "@/lib/connectors/utils"; import { cn } from "@/lib/utils"; import { DateRangeSelector } from "../../components/date-range-selector"; import { PeriodicSyncConfig } from "../../components/periodic-sync-config"; -import { SummaryConfig } from "../../components/summary-config"; import { VisionLLMConfig } from "../../components/vision-llm-config"; import { type IndexingConfigState, @@ -35,7 +34,6 @@ interface IndexingConfigurationViewProps { endDate: Date | undefined; periodicEnabled: boolean; frequencyMinutes: string; - enableSummary: boolean; enableVisionLlm: boolean; isStartingIndexing: boolean; isFromOAuth?: boolean; @@ -43,7 +41,6 @@ interface IndexingConfigurationViewProps { onEndDateChange: (date: Date | undefined) => void; onPeriodicEnabledChange: (enabled: boolean) => void; onFrequencyChange: (frequency: string) => void; - onEnableSummaryChange: (enabled: boolean) => void; onEnableVisionLlmChange: (enabled: boolean) => void; onConfigChange?: (config: Record) => void; onStartIndexing: () => void; @@ -57,7 +54,6 @@ export const IndexingConfigurationView: FC = ({ endDate, periodicEnabled, frequencyMinutes, - enableSummary, enableVisionLlm, isStartingIndexing, isFromOAuth = false, @@ -65,7 +61,6 @@ export const IndexingConfigurationView: FC = ({ onEndDateChange, onPeriodicEnabledChange, onFrequencyChange, - onEnableSummaryChange, onEnableVisionLlmChange, onConfigChange, onStartIndexing, @@ -78,9 +73,11 @@ export const IndexingConfigurationView: FC = ({ () => (connector ? getConnectorConfigComponent(connector.connector_type) : null), [connector] ); - const showsAiToggles = - (connector?.is_indexable ?? false) || - connector?.connector_type === EnumConnectorName.OBSIDIAN_CONNECTOR; + const showsVisionToggle = + !isLive && + ((connector?.is_indexable ?? false) || + connector?.connector_type === EnumConnectorName.OBSIDIAN_CONNECTOR) && + VISION_LLM_CONNECTOR_TYPES.has(config.connectorType); const [isScrolled, setIsScrolled] = useState(false); const [hasMoreContent, setHasMoreContent] = useState(false); const scrollContainerRef = useRef(null); @@ -178,57 +175,46 @@ export const IndexingConfigurationView: FC = ({ )} - {/* Summary + vision toggles (Obsidian is plugin-push, non-indexable by design) */} - {showsAiToggles && !isLive && ( - <> - {/* AI Summary toggle */} - - - {/* Vision LLM toggle for file/attachment connectors */} - {VISION_LLM_CONNECTOR_TYPES.has(config.connectorType) && ( - - )} - - {/* Date-range and periodic sync stay indexable-only */} - {connector?.is_indexable && - config.connectorType !== "GOOGLE_DRIVE_CONNECTOR" && - config.connectorType !== "COMPOSIO_GOOGLE_DRIVE_CONNECTOR" && - config.connectorType !== "DROPBOX_CONNECTOR" && - config.connectorType !== "ONEDRIVE_CONNECTOR" && - config.connectorType !== "WEBCRAWLER_CONNECTOR" && - config.connectorType !== "GITHUB_CONNECTOR" && ( - - )} - - {connector?.is_indexable && - config.connectorType !== "GOOGLE_DRIVE_CONNECTOR" && - config.connectorType !== "COMPOSIO_GOOGLE_DRIVE_CONNECTOR" && - config.connectorType !== "DROPBOX_CONNECTOR" && - config.connectorType !== "ONEDRIVE_CONNECTOR" && ( - - )} - + {/* Vision toggle (Obsidian is plugin-push, non-indexable by design) */} + {showsVisionToggle && ( + )} + {/* Date-range and periodic sync stay indexable-only */} + {connector?.is_indexable && + config.connectorType !== "GOOGLE_DRIVE_CONNECTOR" && + config.connectorType !== "COMPOSIO_GOOGLE_DRIVE_CONNECTOR" && + config.connectorType !== "DROPBOX_CONNECTOR" && + config.connectorType !== "ONEDRIVE_CONNECTOR" && + config.connectorType !== "WEBCRAWLER_CONNECTOR" && + config.connectorType !== "GITHUB_CONNECTOR" && ( + + )} + + {connector?.is_indexable && + config.connectorType !== "GOOGLE_DRIVE_CONNECTOR" && + config.connectorType !== "COMPOSIO_GOOGLE_DRIVE_CONNECTOR" && + config.connectorType !== "DROPBOX_CONNECTOR" && + config.connectorType !== "ONEDRIVE_CONNECTOR" && ( + + )} + {/* Info box - hidden for live connectors */} {connector?.is_indexable && !isLive && ( diff --git a/surfsense_web/components/assistant-ui/connector-popup/hooks/use-connector-dialog.ts b/surfsense_web/components/assistant-ui/connector-popup/hooks/use-connector-dialog.ts index 25ab82e2e..aa9440a12 100644 --- a/surfsense_web/components/assistant-ui/connector-popup/hooks/use-connector-dialog.ts +++ b/surfsense_web/components/assistant-ui/connector-popup/hooks/use-connector-dialog.ts @@ -82,7 +82,6 @@ export const useConnectorDialog = () => { const [isStartingIndexing, setIsStartingIndexing] = useState(false); const [periodicEnabled, setPeriodicEnabled] = useState(false); const [frequencyMinutes, setFrequencyMinutes] = useState("1440"); - const [enableSummary, setEnableSummary] = useState(false); const [enableVisionLlm, setEnableVisionLlm] = useState(false); // Edit mode state @@ -418,7 +417,6 @@ export const useConnectorDialog = () => { periodic_indexing_enabled: false, indexing_frequency_minutes: null, next_scheduled_at: null, - enable_summary: false, enable_vision_llm: false, }, queryParams: { @@ -520,7 +518,6 @@ export const useConnectorDialog = () => { connector_type: connectorData.connector_type as EnumConnectorName, is_active: true, next_scheduled_at: connectorData.next_scheduled_at as string | null, - enable_summary: false, enable_vision_llm: false, }, queryParams: { @@ -657,8 +654,7 @@ export const useConnectorDialog = () => { setConnectorConfig(connector.config || {}); setPeriodicEnabled(false); setFrequencyMinutes("1440"); - setEnableSummary(connector.enable_summary ?? false); - setEnableVisionLlm(connector.enable_vision_llm ?? false); + setEnableVisionLlm(connector.enable_vision_llm ?? false); setStartDate(undefined); setEndDate(undefined); @@ -806,14 +802,13 @@ export const useConnectorDialog = () => { const startDateStr = startDate ? format(startDate, "yyyy-MM-dd") : undefined; const endDateStr = endDate ? format(endDate, "yyyy-MM-dd") : undefined; - // Update connector with summary, periodic sync settings, and config changes - if (enableSummary || enableVisionLlm || periodicEnabled || indexingConnectorConfig) { + // Update connector with vision, periodic sync settings, and config changes + if (enableVisionLlm || periodicEnabled || indexingConnectorConfig) { const frequency = periodicEnabled ? parseInt(frequencyMinutes, 10) : undefined; await updateConnector({ id: indexingConfig.connectorId, data: { - enable_summary: enableSummary, - enable_vision_llm: enableVisionLlm, + enable_vision_llm: enableVisionLlm, ...(periodicEnabled && { periodic_indexing_enabled: true, indexing_frequency_minutes: frequency, @@ -940,7 +935,6 @@ export const useConnectorDialog = () => { updateConnector, periodicEnabled, frequencyMinutes, - enableSummary, enableVisionLlm, indexingConnectorConfig, setIsOpen, @@ -1005,7 +999,6 @@ export const useConnectorDialog = () => { setConnectorName(connector.name); setPeriodicEnabled(!connector.is_indexable ? false : connector.periodic_indexing_enabled); setFrequencyMinutes(connector.indexing_frequency_minutes?.toString() || "1440"); - setEnableSummary(connector.enable_summary ?? false); setEnableVisionLlm(connector.enable_vision_llm ?? false); setStartDate(undefined); setEndDate(undefined); @@ -1084,7 +1077,6 @@ export const useConnectorDialog = () => { id: editingConnector.id, data: { name: connectorName || editingConnector.name, - enable_summary: enableSummary, enable_vision_llm: enableVisionLlm, periodic_indexing_enabled: !editingConnector.is_indexable ? false : periodicEnabled, indexing_frequency_minutes: !editingConnector.is_indexable ? null : frequency, @@ -1219,7 +1211,6 @@ export const useConnectorDialog = () => { updateConnector, periodicEnabled, frequencyMinutes, - enableSummary, enableVisionLlm, getFrequencyLabel, connectorConfig, @@ -1380,7 +1371,6 @@ export const useConnectorDialog = () => { setEndDate(undefined); setPeriodicEnabled(false); setFrequencyMinutes("1440"); - setEnableSummary(false); setEnableVisionLlm(false); } } @@ -1417,7 +1407,6 @@ export const useConnectorDialog = () => { isDisconnecting, periodicEnabled, frequencyMinutes, - enableSummary, enableVisionLlm, searchSpaceId, allConnectors, @@ -1432,7 +1421,6 @@ export const useConnectorDialog = () => { setEndDate, setPeriodicEnabled, setFrequencyMinutes, - setEnableSummary, setEnableVisionLlm, setConnectorName, diff --git a/surfsense_web/components/assistant-ui/document-upload-popup.tsx b/surfsense_web/components/assistant-ui/document-upload-popup.tsx index 477d7ee77..504f1d8d4 100644 --- a/surfsense_web/components/assistant-ui/document-upload-popup.tsx +++ b/surfsense_web/components/assistant-ui/document-upload-popup.tsx @@ -1,8 +1,6 @@ "use client"; import { useAtomValue } from "jotai"; -import { AlertTriangle } from "lucide-react"; -import { useRouter } from "next/navigation"; import { createContext, type FC, @@ -12,14 +10,8 @@ import { useRef, useState, } from "react"; -import { - globalNewLLMConfigsAtom, - llmPreferencesAtom, -} from "@/atoms/new-llm-config/new-llm-config-query.atoms"; import { activeSearchSpaceIdAtom } from "@/atoms/search-spaces/search-space-query.atoms"; import { DocumentUploadTab } from "@/components/sources/DocumentUploadTab"; -import { Alert, AlertDescription, AlertTitle } from "@/components/ui/alert"; -import { Button } from "@/components/ui/button"; import { Dialog, DialogContent, @@ -98,12 +90,7 @@ const DocumentUploadPopupContent: FC<{ isOpen: boolean; onOpenChange: (open: boolean) => void; }> = ({ isOpen, onOpenChange }) => { - const router = useRouter(); const searchSpaceId = useAtomValue(activeSearchSpaceIdAtom); - const { data: preferences = {}, isFetching: preferencesLoading } = - useAtomValue(llmPreferencesAtom); - const { data: globalConfigs = [], isFetching: globalConfigsLoading } = - useAtomValue(globalNewLLMConfigsAtom); if (!searchSpaceId) return null; @@ -111,22 +98,6 @@ const DocumentUploadPopupContent: FC<{ onOpenChange(false); }; - // Check if document summary LLM is properly configured - // - If ID is 0 (Auto mode), we need global configs to be available - // - If ID is positive (user config) or negative (specific global config), it's configured - // - If ID is null/undefined, it's not configured - const docSummaryLlmId = preferences.document_summary_llm_id; - const isAutoMode = docSummaryLlmId === 0; - const hasGlobalConfigs = globalConfigs.length > 0; - - const hasDocumentSummaryLLM = - docSummaryLlmId !== null && - docSummaryLlmId !== undefined && - // If it's Auto mode, we need global configs to actually be available - (!isAutoMode || hasGlobalConfigs); - - const isLoading = preferencesLoading || globalConfigsLoading; - return (
- {!isLoading && !hasDocumentSummaryLLM ? ( -
- - - LLM Configuration Required - -

- {isAutoMode && !hasGlobalConfigs - ? "Auto mode requires a global LLM configuration. Please add one in Settings" - : "A Document Summary LLM is required to process uploads, configure one in Settings"} -

- -
-
-
- ) : ( - - )} +
diff --git a/surfsense_web/components/layout/ui/sidebar/DocumentsSidebar.tsx b/surfsense_web/components/layout/ui/sidebar/DocumentsSidebar.tsx index a90d6b32e..6c6668319 100644 --- a/surfsense_web/components/layout/ui/sidebar/DocumentsSidebar.tsx +++ b/surfsense_web/components/layout/ui/sidebar/DocumentsSidebar.tsx @@ -619,7 +619,6 @@ function AuthenticatedDocumentsSidebarBase({ searchSpaceId, excludePatterns: matched.excludePatterns ?? DEFAULT_EXCLUDE_PATTERNS, fileExtensions: matched.fileExtensions ?? Array.from(getSupportedExtensionsSet()), - enableSummary: false, rootFolderId: folder.id, }); toast.success(`Re-scan complete: ${matched.name}`); diff --git a/surfsense_web/components/settings/llm-role-manager.tsx b/surfsense_web/components/settings/llm-role-manager.tsx index 9af9eec27..6d47a7417 100644 --- a/surfsense_web/components/settings/llm-role-manager.tsx +++ b/surfsense_web/components/settings/llm-role-manager.tsx @@ -55,15 +55,6 @@ const ROLE_DESCRIPTIONS = { prefKey: "agent_llm_id" as const, configType: "llm" as const, }, - document_summary: { - icon: FileText, - title: "Document Summary LLM", - description: "Handles document summarization and research synthesis", - color: "text-muted-foreground", - bgColor: "bg-muted", - prefKey: "document_summary_llm_id" as const, - configType: "llm" as const, - }, image_generation: { icon: ImageIcon, title: "Image Generation Model", @@ -137,7 +128,6 @@ export function LLMRoleManager({ searchSpaceId }: LLMRoleManagerProps) { const [assignments, setAssignments] = useState>(() => ({ agent_llm_id: preferences.agent_llm_id ?? null, - document_summary_llm_id: preferences.document_summary_llm_id ?? null, image_generation_config_id: preferences.image_generation_config_id ?? null, vision_llm_config_id: preferences.vision_llm_config_id ?? null, })); @@ -148,13 +138,11 @@ export function LLMRoleManager({ searchSpaceId }: LLMRoleManagerProps) { useEffect(() => { setAssignments({ agent_llm_id: preferences.agent_llm_id ?? null, - document_summary_llm_id: preferences.document_summary_llm_id ?? null, - image_generation_config_id: preferences.image_generation_config_id ?? null, + image_generation_config_id: preferences.image_generation_config_id ?? null, vision_llm_config_id: preferences.vision_llm_config_id ?? null, }); }, [ preferences.agent_llm_id, - preferences.document_summary_llm_id, preferences.image_generation_config_id, preferences.vision_llm_config_id, ]); diff --git a/surfsense_web/components/sources/DocumentUploadTab.tsx b/surfsense_web/components/sources/DocumentUploadTab.tsx index ce9a5bc74..93b613a0a 100644 --- a/surfsense_web/components/sources/DocumentUploadTab.tsx +++ b/surfsense_web/components/sources/DocumentUploadTab.tsx @@ -139,7 +139,6 @@ export function DocumentUploadTab({ const [files, setFiles] = useState([]); const [uploadProgress, setUploadProgress] = useState(0); const [accordionValue, setAccordionValue] = useState(""); - const [shouldSummarize, setShouldSummarize] = useState(false); const [useVisionLlm, setUseVisionLlm] = useState(false); const [processingMode, setProcessingMode] = useState("basic"); const [uploadDocumentMutation] = useAtom(uploadDocumentMutationAtom); @@ -366,7 +365,6 @@ export function DocumentUploadTab({ search_space_id: Number(searchSpaceId), relative_paths: batch.map((e) => e.relativePath), root_folder_id: rootFolderId, - enable_summary: shouldSummarize, use_vision_llm: useVisionLlm, processing_mode: processingMode, } @@ -414,7 +412,6 @@ export function DocumentUploadTab({ { files: rawFiles, search_space_id: Number(searchSpaceId), - should_summarize: shouldSummarize, use_vision_llm: useVisionLlm, processing_mode: processingMode, }, @@ -696,15 +693,6 @@ export function DocumentUploadTab({
)} -
-
-

Enable AI Summary

-

- Improves search quality but adds latency -

-
- -
diff --git a/surfsense_web/components/sources/FolderWatchDialog.tsx b/surfsense_web/components/sources/FolderWatchDialog.tsx index 4cc566ef6..ff168b2df 100644 --- a/surfsense_web/components/sources/FolderWatchDialog.tsx +++ b/surfsense_web/components/sources/FolderWatchDialog.tsx @@ -12,7 +12,6 @@ import { DialogTitle, } from "@/components/ui/dialog"; import { Spinner } from "@/components/ui/spinner"; -import { Switch } from "@/components/ui/switch"; import { type FolderSyncProgress, uploadFolderScan } from "@/lib/folder-sync-upload"; import { getSupportedExtensionsSet } from "@/lib/supported-extensions"; @@ -46,7 +45,6 @@ export function FolderWatchDialog({ initialFolder, }: FolderWatchDialogProps) { const [selectedFolder, setSelectedFolder] = useState(null); - const [shouldSummarize, setShouldSummarize] = useState(false); const [submitting, setSubmitting] = useState(false); const [progress, setProgress] = useState(null); const abortRef = useRef(null); @@ -91,7 +89,6 @@ export function FolderWatchDialog({ searchSpaceId, excludePatterns: DEFAULT_EXCLUDE_PATTERNS, fileExtensions: supportedExtensions, - enableSummary: shouldSummarize, onProgress: setProgress, signal: controller.signal, }); @@ -108,7 +105,6 @@ export function FolderWatchDialog({ toast.success(`Watching folder: ${selectedFolder.name}`); setSelectedFolder(null); - setShouldSummarize(false); setProgress(null); onOpenChange(false); onSuccess?.(); @@ -126,7 +122,6 @@ export function FolderWatchDialog({ }, [ selectedFolder, searchSpaceId, - shouldSummarize, supportedExtensions, onOpenChange, onSuccess, @@ -136,8 +131,7 @@ export function FolderWatchDialog({ (nextOpen: boolean) => { if (!nextOpen && !submitting) { setSelectedFolder(null); - setShouldSummarize(false); - setProgress(null); + setProgress(null); } onOpenChange(nextOpen); }, @@ -206,15 +200,6 @@ export function FolderWatchDialog({ {selectedFolder && ( <> -
-
-

Enable AI Summary

-

- Improves search quality but adds latency -

-
- -
{progressLabel && (
diff --git a/surfsense_web/contracts/types/document.types.ts b/surfsense_web/contracts/types/document.types.ts index 1d08d77cd..da1dac537 100644 --- a/surfsense_web/contracts/types/document.types.ts +++ b/surfsense_web/contracts/types/document.types.ts @@ -130,7 +130,6 @@ export const processingModeEnum = z.enum(["basic", "premium"]); export const uploadDocumentRequest = z.object({ files: z.array(z.instanceof(File)), search_space_id: z.number(), - should_summarize: z.boolean().default(false), use_vision_llm: z.boolean().default(false), processing_mode: processingModeEnum.default("basic"), }); diff --git a/surfsense_web/hooks/use-connectors-sync.ts b/surfsense_web/hooks/use-connectors-sync.ts index d36728118..00e7350f8 100644 --- a/surfsense_web/hooks/use-connectors-sync.ts +++ b/surfsense_web/hooks/use-connectors-sync.ts @@ -24,7 +24,6 @@ export function useConnectorsSync(searchSpaceId: number | string | null) { is_active: true, last_indexed_at: c.lastIndexedAt ? new Date(c.lastIndexedAt).toISOString() : null, config: (c.config as Record) ?? {}, - enable_summary: c.enableSummary, periodic_indexing_enabled: c.periodicIndexingEnabled, indexing_frequency_minutes: c.indexingFrequencyMinutes ?? null, next_scheduled_at: c.nextScheduledAt ? new Date(c.nextScheduledAt).toISOString() : null, diff --git a/surfsense_web/lib/apis/documents-api.service.ts b/surfsense_web/lib/apis/documents-api.service.ts index 30a36af3c..bc2d609a6 100644 --- a/surfsense_web/lib/apis/documents-api.service.ts +++ b/surfsense_web/lib/apis/documents-api.service.ts @@ -126,8 +126,7 @@ class DocumentsApiService { throw new ValidationError(`Invalid request: ${errorMessage}`); } - const { files, search_space_id, should_summarize, use_vision_llm, processing_mode } = - parsedRequest.data; + const { files, search_space_id, use_vision_llm, processing_mode } = parsedRequest.data; const UPLOAD_BATCH_SIZE = 5; const batches: File[][] = []; @@ -145,7 +144,6 @@ class DocumentsApiService { const formData = new FormData(); for (const file of batch) formData.append("files", file); formData.append("search_space_id", String(search_space_id)); - formData.append("should_summarize", String(should_summarize)); formData.append("use_vision_llm", String(use_vision_llm)); formData.append("processing_mode", processing_mode); @@ -420,7 +418,6 @@ class DocumentsApiService { search_space_id: number; relative_paths: string[]; root_folder_id?: number | null; - enable_summary?: boolean; use_vision_llm?: boolean; processing_mode?: "basic" | "premium"; }, @@ -436,7 +433,6 @@ class DocumentsApiService { if (metadata.root_folder_id != null) { formData.append("root_folder_id", String(metadata.root_folder_id)); } - formData.append("enable_summary", String(metadata.enable_summary ?? false)); formData.append("use_vision_llm", String(metadata.use_vision_llm ?? false)); formData.append("processing_mode", metadata.processing_mode ?? "basic"); diff --git a/surfsense_web/lib/folder-sync-upload.ts b/surfsense_web/lib/folder-sync-upload.ts index 46ee7230a..14109b332 100644 --- a/surfsense_web/lib/folder-sync-upload.ts +++ b/surfsense_web/lib/folder-sync-upload.ts @@ -16,7 +16,6 @@ export interface FolderSyncParams { searchSpaceId: number; excludePatterns: string[]; fileExtensions: string[]; - enableSummary: boolean; processingMode?: "basic" | "premium"; rootFolderId?: number | null; onProgress?: (progress: FolderSyncProgress) => void; @@ -62,8 +61,7 @@ async function uploadBatchesWithConcurrency( folderName: string; searchSpaceId: number; rootFolderId: number | null; - enableSummary: boolean; - processingMode?: "basic" | "premium"; + processingMode?: "basic" | "premium"; signal?: AbortSignal; onBatchComplete?: (filesInBatch: number) => void; } @@ -100,7 +98,6 @@ async function uploadBatchesWithConcurrency( search_space_id: params.searchSpaceId, relative_paths: batch.map((e) => e.relativePath), root_folder_id: resolvedRootFolderId, - enable_summary: params.enableSummary, processing_mode: params.processingMode, }, params.signal @@ -147,7 +144,6 @@ export async function uploadFolderScan(params: FolderSyncParams): Promise { uploaded += count;