mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-06-08 20:25:19 +02:00
feat(web): Remove summary controls from the web app
This commit is contained in:
parent
b5a9bcf87b
commit
e427501482
16 changed files with 123 additions and 376 deletions
|
|
@ -47,14 +47,9 @@ export function DashboardClientLayout({
|
||||||
const { mutateAsync: updatePreferences } = useAtomValue(updateLLMPreferencesMutationAtom);
|
const { mutateAsync: updatePreferences } = useAtomValue(updateLLMPreferencesMutationAtom);
|
||||||
|
|
||||||
const isOnboardingComplete = useCallback(() => {
|
const isOnboardingComplete = useCallback(() => {
|
||||||
// Check that both LLM IDs are set (including 0 for Auto mode)
|
// Check that the Agent LLM ID is set, including 0 for Auto mode.
|
||||||
return (
|
return preferences.agent_llm_id !== null && preferences.agent_llm_id !== undefined;
|
||||||
preferences.agent_llm_id !== null &&
|
}, [preferences.agent_llm_id]);
|
||||||
preferences.agent_llm_id !== undefined &&
|
|
||||||
preferences.document_summary_llm_id !== null &&
|
|
||||||
preferences.document_summary_llm_id !== undefined
|
|
||||||
);
|
|
||||||
}, [preferences]);
|
|
||||||
|
|
||||||
const { data: access = null, isLoading: accessLoading } = useAtomValue(myAccessAtom);
|
const { data: access = null, isLoading: accessLoading } = useAtomValue(myAccessAtom);
|
||||||
const [hasCheckedOnboarding, setHasCheckedOnboarding] = useState(false);
|
const [hasCheckedOnboarding, setHasCheckedOnboarding] = useState(false);
|
||||||
|
|
@ -100,7 +95,6 @@ export function DashboardClientLayout({
|
||||||
search_space_id: Number(searchSpaceId),
|
search_space_id: Number(searchSpaceId),
|
||||||
data: {
|
data: {
|
||||||
agent_llm_id: firstGlobalConfig.id,
|
agent_llm_id: firstGlobalConfig.id,
|
||||||
document_summary_llm_id: firstGlobalConfig.id,
|
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -54,10 +54,7 @@ export default function OnboardPage() {
|
||||||
|
|
||||||
// Check if onboarding is already complete (including 0 for Auto mode)
|
// Check if onboarding is already complete (including 0 for Auto mode)
|
||||||
const isOnboardingComplete =
|
const isOnboardingComplete =
|
||||||
preferences.agent_llm_id !== null &&
|
preferences.agent_llm_id !== null && preferences.agent_llm_id !== undefined;
|
||||||
preferences.agent_llm_id !== undefined &&
|
|
||||||
preferences.document_summary_llm_id !== null &&
|
|
||||||
preferences.document_summary_llm_id !== undefined;
|
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (!preferencesLoading && isOnboardingComplete) {
|
if (!preferencesLoading && isOnboardingComplete) {
|
||||||
|
|
@ -83,7 +80,6 @@ export default function OnboardPage() {
|
||||||
search_space_id: searchSpaceId,
|
search_space_id: searchSpaceId,
|
||||||
data: {
|
data: {
|
||||||
agent_llm_id: firstGlobalConfig.id,
|
agent_llm_id: firstGlobalConfig.id,
|
||||||
document_summary_llm_id: firstGlobalConfig.id,
|
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
@ -120,7 +116,6 @@ export default function OnboardPage() {
|
||||||
search_space_id: searchSpaceId,
|
search_space_id: searchSpaceId,
|
||||||
data: {
|
data: {
|
||||||
agent_llm_id: newConfig.id,
|
agent_llm_id: newConfig.id,
|
||||||
document_summary_llm_id: newConfig.id,
|
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,18 +1,10 @@
|
||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
import { useAtomValue } from "jotai";
|
import { useAtomValue } from "jotai";
|
||||||
import { AlertTriangle } from "lucide-react";
|
|
||||||
import { useRouter } from "next/navigation";
|
|
||||||
import { forwardRef, useEffect, useImperativeHandle, useMemo, useState } from "react";
|
import { forwardRef, useEffect, useImperativeHandle, useMemo, useState } from "react";
|
||||||
import { createPortal } from "react-dom";
|
import { createPortal } from "react-dom";
|
||||||
import { statusInboxItemsAtom } from "@/atoms/inbox/status-inbox.atom";
|
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 { 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 { Dialog, DialogContent, DialogTitle } from "@/components/ui/dialog";
|
||||||
import { Tabs, TabsContent } from "@/components/ui/tabs";
|
import { Tabs, TabsContent } from "@/components/ui/tabs";
|
||||||
import type { SearchSourceConnector } from "@/contracts/types/connector.types";
|
import type { SearchSourceConnector } from "@/contracts/types/connector.types";
|
||||||
|
|
@ -44,28 +36,7 @@ interface ConnectorIndicatorProps {
|
||||||
|
|
||||||
export const ConnectorIndicator = forwardRef<ConnectorIndicatorHandle, ConnectorIndicatorProps>(
|
export const ConnectorIndicator = forwardRef<ConnectorIndicatorHandle, ConnectorIndicatorProps>(
|
||||||
(_props, ref) => {
|
(_props, ref) => {
|
||||||
const router = useRouter();
|
|
||||||
const searchSpaceId = useAtomValue(activeSearchSpaceIdAtom);
|
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)
|
// Real-time document type counts via Zero (updates instantly as docs are indexed)
|
||||||
const documentTypeCounts = useZeroDocumentTypeCounts(searchSpaceId);
|
const documentTypeCounts = useZeroDocumentTypeCounts(searchSpaceId);
|
||||||
|
|
@ -97,7 +68,6 @@ export const ConnectorIndicator = forwardRef<ConnectorIndicatorHandle, Connector
|
||||||
isDisconnecting,
|
isDisconnecting,
|
||||||
periodicEnabled,
|
periodicEnabled,
|
||||||
frequencyMinutes,
|
frequencyMinutes,
|
||||||
enableSummary,
|
|
||||||
enableVisionLlm,
|
enableVisionLlm,
|
||||||
allConnectors,
|
allConnectors,
|
||||||
viewingAccountsType,
|
viewingAccountsType,
|
||||||
|
|
@ -109,7 +79,6 @@ export const ConnectorIndicator = forwardRef<ConnectorIndicatorHandle, Connector
|
||||||
setEndDate,
|
setEndDate,
|
||||||
setPeriodicEnabled,
|
setPeriodicEnabled,
|
||||||
setFrequencyMinutes,
|
setFrequencyMinutes,
|
||||||
setEnableSummary,
|
|
||||||
setEnableVisionLlm,
|
setEnableVisionLlm,
|
||||||
handleOpenChange,
|
handleOpenChange,
|
||||||
handleTabChange,
|
handleTabChange,
|
||||||
|
|
@ -280,7 +249,6 @@ export const ConnectorIndicator = forwardRef<ConnectorIndicatorHandle, Connector
|
||||||
endDate={endDate}
|
endDate={endDate}
|
||||||
periodicEnabled={periodicEnabled}
|
periodicEnabled={periodicEnabled}
|
||||||
frequencyMinutes={frequencyMinutes}
|
frequencyMinutes={frequencyMinutes}
|
||||||
enableSummary={enableSummary}
|
|
||||||
enableVisionLlm={enableVisionLlm}
|
enableVisionLlm={enableVisionLlm}
|
||||||
isSaving={isSaving}
|
isSaving={isSaving}
|
||||||
isDisconnecting={isDisconnecting}
|
isDisconnecting={isDisconnecting}
|
||||||
|
|
@ -290,7 +258,6 @@ export const ConnectorIndicator = forwardRef<ConnectorIndicatorHandle, Connector
|
||||||
onEndDateChange={setEndDate}
|
onEndDateChange={setEndDate}
|
||||||
onPeriodicEnabledChange={setPeriodicEnabled}
|
onPeriodicEnabledChange={setPeriodicEnabled}
|
||||||
onFrequencyChange={setFrequencyMinutes}
|
onFrequencyChange={setFrequencyMinutes}
|
||||||
onEnableSummaryChange={setEnableSummary}
|
|
||||||
onEnableVisionLlmChange={setEnableVisionLlm}
|
onEnableVisionLlmChange={setEnableVisionLlm}
|
||||||
onSave={() => {
|
onSave={() => {
|
||||||
startIndexing(editingConnector.id);
|
startIndexing(editingConnector.id);
|
||||||
|
|
@ -339,7 +306,6 @@ export const ConnectorIndicator = forwardRef<ConnectorIndicatorHandle, Connector
|
||||||
endDate={endDate}
|
endDate={endDate}
|
||||||
periodicEnabled={periodicEnabled}
|
periodicEnabled={periodicEnabled}
|
||||||
frequencyMinutes={frequencyMinutes}
|
frequencyMinutes={frequencyMinutes}
|
||||||
enableSummary={enableSummary}
|
|
||||||
enableVisionLlm={enableVisionLlm}
|
enableVisionLlm={enableVisionLlm}
|
||||||
isStartingIndexing={isStartingIndexing}
|
isStartingIndexing={isStartingIndexing}
|
||||||
isFromOAuth={isFromOAuth}
|
isFromOAuth={isFromOAuth}
|
||||||
|
|
@ -347,7 +313,6 @@ export const ConnectorIndicator = forwardRef<ConnectorIndicatorHandle, Connector
|
||||||
onEndDateChange={setEndDate}
|
onEndDateChange={setEndDate}
|
||||||
onPeriodicEnabledChange={setPeriodicEnabled}
|
onPeriodicEnabledChange={setPeriodicEnabled}
|
||||||
onFrequencyChange={setFrequencyMinutes}
|
onFrequencyChange={setFrequencyMinutes}
|
||||||
onEnableSummaryChange={setEnableSummary}
|
|
||||||
onEnableVisionLlmChange={setEnableVisionLlm}
|
onEnableVisionLlmChange={setEnableVisionLlm}
|
||||||
onConfigChange={setIndexingConnectorConfig}
|
onConfigChange={setIndexingConnectorConfig}
|
||||||
onStartIndexing={() => {
|
onStartIndexing={() => {
|
||||||
|
|
@ -378,35 +343,6 @@ export const ConnectorIndicator = forwardRef<ConnectorIndicatorHandle, Connector
|
||||||
<div className="flex-1 min-h-0 relative overflow-hidden">
|
<div className="flex-1 min-h-0 relative overflow-hidden">
|
||||||
<div className="h-full overflow-y-auto" onScroll={handleScroll}>
|
<div className="h-full overflow-y-auto" onScroll={handleScroll}>
|
||||||
<div className="px-4 sm:px-12 py-4 sm:py-8 pb-12 sm:pb-16">
|
<div className="px-4 sm:px-12 py-4 sm:py-8 pb-12 sm:pb-16">
|
||||||
{/* LLM Configuration Warning */}
|
|
||||||
{!llmConfigLoading && !hasDocumentSummaryLLM && (
|
|
||||||
<div className="mb-6">
|
|
||||||
<Alert variant="warning">
|
|
||||||
<AlertTriangle />
|
|
||||||
<AlertTitle>LLM Configuration Required</AlertTitle>
|
|
||||||
<AlertDescription>
|
|
||||||
<p>
|
|
||||||
{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"}
|
|
||||||
</p>
|
|
||||||
<Button
|
|
||||||
size="sm"
|
|
||||||
variant="secondary"
|
|
||||||
onClick={() => {
|
|
||||||
handleOpenChange(false);
|
|
||||||
router.push(
|
|
||||||
`/dashboard/${searchSpaceId}/search-space-settings/models`
|
|
||||||
);
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
Go to Settings
|
|
||||||
</Button>
|
|
||||||
</AlertDescription>
|
|
||||||
</Alert>
|
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
|
|
||||||
<TabsContent value="all" className="m-0">
|
<TabsContent value="all" className="m-0">
|
||||||
<AllConnectorsTab
|
<AllConnectorsTab
|
||||||
searchQuery={searchQuery}
|
searchQuery={searchQuery}
|
||||||
|
|
@ -416,14 +352,10 @@ export const ConnectorIndicator = forwardRef<ConnectorIndicatorHandle, Connector
|
||||||
allConnectors={connectors}
|
allConnectors={connectors}
|
||||||
documentTypeCounts={documentTypeCounts}
|
documentTypeCounts={documentTypeCounts}
|
||||||
indexingConnectorIds={indexingConnectorIds}
|
indexingConnectorIds={indexingConnectorIds}
|
||||||
onConnectOAuth={hasDocumentSummaryLLM ? handleConnectOAuth : () => {}}
|
onConnectOAuth={handleConnectOAuth}
|
||||||
onConnectNonOAuth={hasDocumentSummaryLLM ? handleConnectNonOAuth : () => {}}
|
onConnectNonOAuth={handleConnectNonOAuth}
|
||||||
onCreateWebcrawler={
|
onCreateWebcrawler={handleCreateWebcrawler}
|
||||||
hasDocumentSummaryLLM ? handleCreateWebcrawler : () => {}
|
onCreateYouTubeCrawler={handleCreateYouTubeCrawler}
|
||||||
}
|
|
||||||
onCreateYouTubeCrawler={
|
|
||||||
hasDocumentSummaryLLM ? handleCreateYouTubeCrawler : () => {}
|
|
||||||
}
|
|
||||||
onManage={handleStartEdit}
|
onManage={handleStartEdit}
|
||||||
onViewAccountsList={handleViewAccountsList}
|
onViewAccountsList={handleViewAccountsList}
|
||||||
/>
|
/>
|
||||||
|
|
|
||||||
|
|
@ -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<SummaryConfigProps> = ({ enabled, onEnabledChange }) => {
|
|
||||||
return (
|
|
||||||
<div className="rounded-xl bg-slate-400/5 dark:bg-white/5 p-3 sm:p-6">
|
|
||||||
<div className="flex items-center justify-between">
|
|
||||||
<div className="space-y-1">
|
|
||||||
<h3 className="font-medium text-sm sm:text-base">Enable AI Summary</h3>
|
|
||||||
<p className="text-xs sm:text-sm text-muted-foreground">
|
|
||||||
Improves search quality but adds latency during indexing
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
<Switch checked={enabled} onCheckedChange={onEnabledChange} />
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
@ -17,7 +17,6 @@ import { BACKEND_URL } from "@/lib/env-config";
|
||||||
import { cn } from "@/lib/utils";
|
import { cn } from "@/lib/utils";
|
||||||
import { DateRangeSelector } from "../../components/date-range-selector";
|
import { DateRangeSelector } from "../../components/date-range-selector";
|
||||||
import { PeriodicSyncConfig } from "../../components/periodic-sync-config";
|
import { PeriodicSyncConfig } from "../../components/periodic-sync-config";
|
||||||
import { SummaryConfig } from "../../components/summary-config";
|
|
||||||
import { VisionLLMConfig } from "../../components/vision-llm-config";
|
import { VisionLLMConfig } from "../../components/vision-llm-config";
|
||||||
import { LIVE_CONNECTOR_TYPES } from "../../constants/connector-constants";
|
import { LIVE_CONNECTOR_TYPES } from "../../constants/connector-constants";
|
||||||
import { getConnectorDisplayName } from "../../tabs/all-connectors-tab";
|
import { getConnectorDisplayName } from "../../tabs/all-connectors-tab";
|
||||||
|
|
@ -38,7 +37,6 @@ interface ConnectorEditViewProps {
|
||||||
endDate: Date | undefined;
|
endDate: Date | undefined;
|
||||||
periodicEnabled: boolean;
|
periodicEnabled: boolean;
|
||||||
frequencyMinutes: string;
|
frequencyMinutes: string;
|
||||||
enableSummary: boolean;
|
|
||||||
enableVisionLlm: boolean;
|
enableVisionLlm: boolean;
|
||||||
isSaving: boolean;
|
isSaving: boolean;
|
||||||
isDisconnecting: boolean;
|
isDisconnecting: boolean;
|
||||||
|
|
@ -48,7 +46,6 @@ interface ConnectorEditViewProps {
|
||||||
onEndDateChange: (date: Date | undefined) => void;
|
onEndDateChange: (date: Date | undefined) => void;
|
||||||
onPeriodicEnabledChange: (enabled: boolean) => void;
|
onPeriodicEnabledChange: (enabled: boolean) => void;
|
||||||
onFrequencyChange: (frequency: string) => void;
|
onFrequencyChange: (frequency: string) => void;
|
||||||
onEnableSummaryChange: (enabled: boolean) => void;
|
|
||||||
onEnableVisionLlmChange: (enabled: boolean) => void;
|
onEnableVisionLlmChange: (enabled: boolean) => void;
|
||||||
onSave: () => void;
|
onSave: () => void;
|
||||||
onDisconnect: () => void;
|
onDisconnect: () => void;
|
||||||
|
|
@ -64,7 +61,6 @@ export const ConnectorEditView: FC<ConnectorEditViewProps> = ({
|
||||||
endDate,
|
endDate,
|
||||||
periodicEnabled,
|
periodicEnabled,
|
||||||
frequencyMinutes,
|
frequencyMinutes,
|
||||||
enableSummary,
|
|
||||||
enableVisionLlm,
|
enableVisionLlm,
|
||||||
isSaving,
|
isSaving,
|
||||||
isDisconnecting,
|
isDisconnecting,
|
||||||
|
|
@ -74,7 +70,6 @@ export const ConnectorEditView: FC<ConnectorEditViewProps> = ({
|
||||||
onEndDateChange,
|
onEndDateChange,
|
||||||
onPeriodicEnabledChange,
|
onPeriodicEnabledChange,
|
||||||
onFrequencyChange,
|
onFrequencyChange,
|
||||||
onEnableSummaryChange,
|
|
||||||
onEnableVisionLlmChange,
|
onEnableVisionLlmChange,
|
||||||
onSave,
|
onSave,
|
||||||
onDisconnect,
|
onDisconnect,
|
||||||
|
|
@ -87,9 +82,13 @@ export const ConnectorEditView: FC<ConnectorEditViewProps> = ({
|
||||||
const isAuthExpired = connector.config?.auth_expired === true;
|
const isAuthExpired = connector.config?.auth_expired === true;
|
||||||
const reauthEndpoint = getReauthEndpoint(connector);
|
const reauthEndpoint = getReauthEndpoint(connector);
|
||||||
const [reauthing, setReauthing] = useState(false);
|
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 supportsVisionLlm = VISION_LLM_CONNECTOR_TYPES.has(connector.connector_type);
|
||||||
const showsAiToggles =
|
const showsVisionToggle =
|
||||||
connector.is_indexable || connector.connector_type === EnumConnectorName.OBSIDIAN_CONNECTOR;
|
!isLive &&
|
||||||
|
supportsVisionLlm &&
|
||||||
|
(connector.is_indexable || connector.connector_type === EnumConnectorName.OBSIDIAN_CONNECTOR);
|
||||||
|
|
||||||
const handleReauth = useCallback(async () => {
|
const handleReauth = useCallback(async () => {
|
||||||
const spaceId = searchSpaceId ?? searchSpaceIdAtom;
|
const spaceId = searchSpaceId ?? searchSpaceIdAtom;
|
||||||
|
|
@ -121,9 +120,6 @@ export const ConnectorEditView: FC<ConnectorEditViewProps> = ({
|
||||||
}
|
}
|
||||||
}, [searchSpaceId, searchSpaceIdAtom, reauthEndpoint, connector.id]);
|
}, [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)
|
// Get connector-specific config component (MCP-backed connectors use a generic view)
|
||||||
const ConnectorConfigComponent = useMemo(() => {
|
const ConnectorConfigComponent = useMemo(() => {
|
||||||
if (isMCPBacked) return MCPServiceConfig;
|
if (isMCPBacked) return MCPServiceConfig;
|
||||||
|
|
@ -280,77 +276,64 @@ export const ConnectorEditView: FC<ConnectorEditViewProps> = ({
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{/* Summary + vision toggles (Obsidian is plugin-push, non-indexable by design) */}
|
{/* Vision toggle (Obsidian is plugin-push, non-indexable by design) */}
|
||||||
{showsAiToggles && !isLive && (
|
{showsVisionToggle && (
|
||||||
<>
|
<VisionLLMConfig enabled={enableVisionLlm} onEnabledChange={onEnableVisionLlmChange} />
|
||||||
{/* AI Summary toggle */}
|
|
||||||
<SummaryConfig enabled={enableSummary} onEnabledChange={onEnableSummaryChange} />
|
|
||||||
|
|
||||||
{/* Vision LLM toggle for file/attachment connectors */}
|
|
||||||
{supportsVisionLlm && (
|
|
||||||
<VisionLLMConfig
|
|
||||||
enabled={enableVisionLlm}
|
|
||||||
onEnabledChange={onEnableVisionLlmChange}
|
|
||||||
/>
|
|
||||||
)}
|
|
||||||
|
|
||||||
{/* 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" && (
|
|
||||||
<DateRangeSelector
|
|
||||||
startDate={startDate}
|
|
||||||
endDate={endDate}
|
|
||||||
onStartDateChange={onStartDateChange}
|
|
||||||
onEndDateChange={onEndDateChange}
|
|
||||||
allowFutureDates={
|
|
||||||
connector.connector_type === "GOOGLE_CALENDAR_CONNECTOR" ||
|
|
||||||
connector.connector_type === "COMPOSIO_GOOGLE_CALENDAR_CONNECTOR" ||
|
|
||||||
connector.connector_type === "LUMA_CONNECTOR"
|
|
||||||
}
|
|
||||||
lastIndexedAt={connector.last_indexed_at}
|
|
||||||
/>
|
|
||||||
)}
|
|
||||||
|
|
||||||
{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 (
|
|
||||||
<PeriodicSyncConfig
|
|
||||||
enabled={periodicEnabled}
|
|
||||||
frequencyMinutes={frequencyMinutes}
|
|
||||||
onEnabledChange={onPeriodicEnabledChange}
|
|
||||||
onFrequencyChange={onFrequencyChange}
|
|
||||||
disabled={isDisabled}
|
|
||||||
disabledMessage={
|
|
||||||
isDisabled
|
|
||||||
? "Select at least one folder or file above to enable periodic sync"
|
|
||||||
: undefined
|
|
||||||
}
|
|
||||||
/>
|
|
||||||
);
|
|
||||||
})()}
|
|
||||||
</>
|
|
||||||
)}
|
)}
|
||||||
|
|
||||||
|
{/* 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" && (
|
||||||
|
<DateRangeSelector
|
||||||
|
startDate={startDate}
|
||||||
|
endDate={endDate}
|
||||||
|
onStartDateChange={onStartDateChange}
|
||||||
|
onEndDateChange={onEndDateChange}
|
||||||
|
allowFutureDates={
|
||||||
|
connector.connector_type === "GOOGLE_CALENDAR_CONNECTOR" ||
|
||||||
|
connector.connector_type === "COMPOSIO_GOOGLE_CALENDAR_CONNECTOR" ||
|
||||||
|
connector.connector_type === "LUMA_CONNECTOR"
|
||||||
|
}
|
||||||
|
lastIndexedAt={connector.last_indexed_at}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
|
||||||
|
{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 (
|
||||||
|
<PeriodicSyncConfig
|
||||||
|
enabled={periodicEnabled}
|
||||||
|
frequencyMinutes={frequencyMinutes}
|
||||||
|
onEnabledChange={onPeriodicEnabledChange}
|
||||||
|
onFrequencyChange={onFrequencyChange}
|
||||||
|
disabled={isDisabled}
|
||||||
|
disabledMessage={
|
||||||
|
isDisabled
|
||||||
|
? "Select at least one folder or file above to enable periodic sync"
|
||||||
|
: undefined
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
})()}
|
||||||
|
|
||||||
{/* Info box - hidden for live connectors */}
|
{/* Info box - hidden for live connectors */}
|
||||||
{connector.is_indexable && !isLive && (
|
{connector.is_indexable && !isLive && (
|
||||||
<Alert>
|
<Alert>
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,6 @@ import { getConnectorTypeDisplay } from "@/lib/connectors/utils";
|
||||||
import { cn } from "@/lib/utils";
|
import { cn } from "@/lib/utils";
|
||||||
import { DateRangeSelector } from "../../components/date-range-selector";
|
import { DateRangeSelector } from "../../components/date-range-selector";
|
||||||
import { PeriodicSyncConfig } from "../../components/periodic-sync-config";
|
import { PeriodicSyncConfig } from "../../components/periodic-sync-config";
|
||||||
import { SummaryConfig } from "../../components/summary-config";
|
|
||||||
import { VisionLLMConfig } from "../../components/vision-llm-config";
|
import { VisionLLMConfig } from "../../components/vision-llm-config";
|
||||||
import {
|
import {
|
||||||
type IndexingConfigState,
|
type IndexingConfigState,
|
||||||
|
|
@ -35,7 +34,6 @@ interface IndexingConfigurationViewProps {
|
||||||
endDate: Date | undefined;
|
endDate: Date | undefined;
|
||||||
periodicEnabled: boolean;
|
periodicEnabled: boolean;
|
||||||
frequencyMinutes: string;
|
frequencyMinutes: string;
|
||||||
enableSummary: boolean;
|
|
||||||
enableVisionLlm: boolean;
|
enableVisionLlm: boolean;
|
||||||
isStartingIndexing: boolean;
|
isStartingIndexing: boolean;
|
||||||
isFromOAuth?: boolean;
|
isFromOAuth?: boolean;
|
||||||
|
|
@ -43,7 +41,6 @@ interface IndexingConfigurationViewProps {
|
||||||
onEndDateChange: (date: Date | undefined) => void;
|
onEndDateChange: (date: Date | undefined) => void;
|
||||||
onPeriodicEnabledChange: (enabled: boolean) => void;
|
onPeriodicEnabledChange: (enabled: boolean) => void;
|
||||||
onFrequencyChange: (frequency: string) => void;
|
onFrequencyChange: (frequency: string) => void;
|
||||||
onEnableSummaryChange: (enabled: boolean) => void;
|
|
||||||
onEnableVisionLlmChange: (enabled: boolean) => void;
|
onEnableVisionLlmChange: (enabled: boolean) => void;
|
||||||
onConfigChange?: (config: Record<string, unknown>) => void;
|
onConfigChange?: (config: Record<string, unknown>) => void;
|
||||||
onStartIndexing: () => void;
|
onStartIndexing: () => void;
|
||||||
|
|
@ -57,7 +54,6 @@ export const IndexingConfigurationView: FC<IndexingConfigurationViewProps> = ({
|
||||||
endDate,
|
endDate,
|
||||||
periodicEnabled,
|
periodicEnabled,
|
||||||
frequencyMinutes,
|
frequencyMinutes,
|
||||||
enableSummary,
|
|
||||||
enableVisionLlm,
|
enableVisionLlm,
|
||||||
isStartingIndexing,
|
isStartingIndexing,
|
||||||
isFromOAuth = false,
|
isFromOAuth = false,
|
||||||
|
|
@ -65,7 +61,6 @@ export const IndexingConfigurationView: FC<IndexingConfigurationViewProps> = ({
|
||||||
onEndDateChange,
|
onEndDateChange,
|
||||||
onPeriodicEnabledChange,
|
onPeriodicEnabledChange,
|
||||||
onFrequencyChange,
|
onFrequencyChange,
|
||||||
onEnableSummaryChange,
|
|
||||||
onEnableVisionLlmChange,
|
onEnableVisionLlmChange,
|
||||||
onConfigChange,
|
onConfigChange,
|
||||||
onStartIndexing,
|
onStartIndexing,
|
||||||
|
|
@ -78,9 +73,11 @@ export const IndexingConfigurationView: FC<IndexingConfigurationViewProps> = ({
|
||||||
() => (connector ? getConnectorConfigComponent(connector.connector_type) : null),
|
() => (connector ? getConnectorConfigComponent(connector.connector_type) : null),
|
||||||
[connector]
|
[connector]
|
||||||
);
|
);
|
||||||
const showsAiToggles =
|
const showsVisionToggle =
|
||||||
(connector?.is_indexable ?? false) ||
|
!isLive &&
|
||||||
connector?.connector_type === EnumConnectorName.OBSIDIAN_CONNECTOR;
|
((connector?.is_indexable ?? false) ||
|
||||||
|
connector?.connector_type === EnumConnectorName.OBSIDIAN_CONNECTOR) &&
|
||||||
|
VISION_LLM_CONNECTOR_TYPES.has(config.connectorType);
|
||||||
const [isScrolled, setIsScrolled] = useState(false);
|
const [isScrolled, setIsScrolled] = useState(false);
|
||||||
const [hasMoreContent, setHasMoreContent] = useState(false);
|
const [hasMoreContent, setHasMoreContent] = useState(false);
|
||||||
const scrollContainerRef = useRef<HTMLDivElement>(null);
|
const scrollContainerRef = useRef<HTMLDivElement>(null);
|
||||||
|
|
@ -178,57 +175,46 @@ export const IndexingConfigurationView: FC<IndexingConfigurationViewProps> = ({
|
||||||
<ConnectorConfigComponent connector={connector} onConfigChange={onConfigChange} />
|
<ConnectorConfigComponent connector={connector} onConfigChange={onConfigChange} />
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{/* Summary + vision toggles (Obsidian is plugin-push, non-indexable by design) */}
|
{/* Vision toggle (Obsidian is plugin-push, non-indexable by design) */}
|
||||||
{showsAiToggles && !isLive && (
|
{showsVisionToggle && (
|
||||||
<>
|
<VisionLLMConfig enabled={enableVisionLlm} onEnabledChange={onEnableVisionLlmChange} />
|
||||||
{/* AI Summary toggle */}
|
|
||||||
<SummaryConfig enabled={enableSummary} onEnabledChange={onEnableSummaryChange} />
|
|
||||||
|
|
||||||
{/* Vision LLM toggle for file/attachment connectors */}
|
|
||||||
{VISION_LLM_CONNECTOR_TYPES.has(config.connectorType) && (
|
|
||||||
<VisionLLMConfig
|
|
||||||
enabled={enableVisionLlm}
|
|
||||||
onEnabledChange={onEnableVisionLlmChange}
|
|
||||||
/>
|
|
||||||
)}
|
|
||||||
|
|
||||||
{/* 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" && (
|
|
||||||
<DateRangeSelector
|
|
||||||
startDate={startDate}
|
|
||||||
endDate={endDate}
|
|
||||||
onStartDateChange={onStartDateChange}
|
|
||||||
onEndDateChange={onEndDateChange}
|
|
||||||
allowFutureDates={
|
|
||||||
config.connectorType === "GOOGLE_CALENDAR_CONNECTOR" ||
|
|
||||||
config.connectorType === "COMPOSIO_GOOGLE_CALENDAR_CONNECTOR" ||
|
|
||||||
config.connectorType === "LUMA_CONNECTOR"
|
|
||||||
}
|
|
||||||
lastIndexedAt={connector?.last_indexed_at}
|
|
||||||
/>
|
|
||||||
)}
|
|
||||||
|
|
||||||
{connector?.is_indexable &&
|
|
||||||
config.connectorType !== "GOOGLE_DRIVE_CONNECTOR" &&
|
|
||||||
config.connectorType !== "COMPOSIO_GOOGLE_DRIVE_CONNECTOR" &&
|
|
||||||
config.connectorType !== "DROPBOX_CONNECTOR" &&
|
|
||||||
config.connectorType !== "ONEDRIVE_CONNECTOR" && (
|
|
||||||
<PeriodicSyncConfig
|
|
||||||
enabled={periodicEnabled}
|
|
||||||
frequencyMinutes={frequencyMinutes}
|
|
||||||
onEnabledChange={onPeriodicEnabledChange}
|
|
||||||
onFrequencyChange={onFrequencyChange}
|
|
||||||
/>
|
|
||||||
)}
|
|
||||||
</>
|
|
||||||
)}
|
)}
|
||||||
|
|
||||||
|
{/* 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" && (
|
||||||
|
<DateRangeSelector
|
||||||
|
startDate={startDate}
|
||||||
|
endDate={endDate}
|
||||||
|
onStartDateChange={onStartDateChange}
|
||||||
|
onEndDateChange={onEndDateChange}
|
||||||
|
allowFutureDates={
|
||||||
|
config.connectorType === "GOOGLE_CALENDAR_CONNECTOR" ||
|
||||||
|
config.connectorType === "COMPOSIO_GOOGLE_CALENDAR_CONNECTOR" ||
|
||||||
|
config.connectorType === "LUMA_CONNECTOR"
|
||||||
|
}
|
||||||
|
lastIndexedAt={connector?.last_indexed_at}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
|
||||||
|
{connector?.is_indexable &&
|
||||||
|
config.connectorType !== "GOOGLE_DRIVE_CONNECTOR" &&
|
||||||
|
config.connectorType !== "COMPOSIO_GOOGLE_DRIVE_CONNECTOR" &&
|
||||||
|
config.connectorType !== "DROPBOX_CONNECTOR" &&
|
||||||
|
config.connectorType !== "ONEDRIVE_CONNECTOR" && (
|
||||||
|
<PeriodicSyncConfig
|
||||||
|
enabled={periodicEnabled}
|
||||||
|
frequencyMinutes={frequencyMinutes}
|
||||||
|
onEnabledChange={onPeriodicEnabledChange}
|
||||||
|
onFrequencyChange={onFrequencyChange}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
|
||||||
{/* Info box - hidden for live connectors */}
|
{/* Info box - hidden for live connectors */}
|
||||||
{connector?.is_indexable && !isLive && (
|
{connector?.is_indexable && !isLive && (
|
||||||
<Alert>
|
<Alert>
|
||||||
|
|
|
||||||
|
|
@ -82,7 +82,6 @@ export const useConnectorDialog = () => {
|
||||||
const [isStartingIndexing, setIsStartingIndexing] = useState(false);
|
const [isStartingIndexing, setIsStartingIndexing] = useState(false);
|
||||||
const [periodicEnabled, setPeriodicEnabled] = useState(false);
|
const [periodicEnabled, setPeriodicEnabled] = useState(false);
|
||||||
const [frequencyMinutes, setFrequencyMinutes] = useState("1440");
|
const [frequencyMinutes, setFrequencyMinutes] = useState("1440");
|
||||||
const [enableSummary, setEnableSummary] = useState(false);
|
|
||||||
const [enableVisionLlm, setEnableVisionLlm] = useState(false);
|
const [enableVisionLlm, setEnableVisionLlm] = useState(false);
|
||||||
|
|
||||||
// Edit mode state
|
// Edit mode state
|
||||||
|
|
@ -418,7 +417,6 @@ export const useConnectorDialog = () => {
|
||||||
periodic_indexing_enabled: false,
|
periodic_indexing_enabled: false,
|
||||||
indexing_frequency_minutes: null,
|
indexing_frequency_minutes: null,
|
||||||
next_scheduled_at: null,
|
next_scheduled_at: null,
|
||||||
enable_summary: false,
|
|
||||||
enable_vision_llm: false,
|
enable_vision_llm: false,
|
||||||
},
|
},
|
||||||
queryParams: {
|
queryParams: {
|
||||||
|
|
@ -520,7 +518,6 @@ export const useConnectorDialog = () => {
|
||||||
connector_type: connectorData.connector_type as EnumConnectorName,
|
connector_type: connectorData.connector_type as EnumConnectorName,
|
||||||
is_active: true,
|
is_active: true,
|
||||||
next_scheduled_at: connectorData.next_scheduled_at as string | null,
|
next_scheduled_at: connectorData.next_scheduled_at as string | null,
|
||||||
enable_summary: false,
|
|
||||||
enable_vision_llm: false,
|
enable_vision_llm: false,
|
||||||
},
|
},
|
||||||
queryParams: {
|
queryParams: {
|
||||||
|
|
@ -657,8 +654,7 @@ export const useConnectorDialog = () => {
|
||||||
setConnectorConfig(connector.config || {});
|
setConnectorConfig(connector.config || {});
|
||||||
setPeriodicEnabled(false);
|
setPeriodicEnabled(false);
|
||||||
setFrequencyMinutes("1440");
|
setFrequencyMinutes("1440");
|
||||||
setEnableSummary(connector.enable_summary ?? false);
|
setEnableVisionLlm(connector.enable_vision_llm ?? false);
|
||||||
setEnableVisionLlm(connector.enable_vision_llm ?? false);
|
|
||||||
setStartDate(undefined);
|
setStartDate(undefined);
|
||||||
setEndDate(undefined);
|
setEndDate(undefined);
|
||||||
|
|
||||||
|
|
@ -806,14 +802,13 @@ export const useConnectorDialog = () => {
|
||||||
const startDateStr = startDate ? format(startDate, "yyyy-MM-dd") : undefined;
|
const startDateStr = startDate ? format(startDate, "yyyy-MM-dd") : undefined;
|
||||||
const endDateStr = endDate ? format(endDate, "yyyy-MM-dd") : undefined;
|
const endDateStr = endDate ? format(endDate, "yyyy-MM-dd") : undefined;
|
||||||
|
|
||||||
// Update connector with summary, periodic sync settings, and config changes
|
// Update connector with vision, periodic sync settings, and config changes
|
||||||
if (enableSummary || enableVisionLlm || periodicEnabled || indexingConnectorConfig) {
|
if (enableVisionLlm || periodicEnabled || indexingConnectorConfig) {
|
||||||
const frequency = periodicEnabled ? parseInt(frequencyMinutes, 10) : undefined;
|
const frequency = periodicEnabled ? parseInt(frequencyMinutes, 10) : undefined;
|
||||||
await updateConnector({
|
await updateConnector({
|
||||||
id: indexingConfig.connectorId,
|
id: indexingConfig.connectorId,
|
||||||
data: {
|
data: {
|
||||||
enable_summary: enableSummary,
|
enable_vision_llm: enableVisionLlm,
|
||||||
enable_vision_llm: enableVisionLlm,
|
|
||||||
...(periodicEnabled && {
|
...(periodicEnabled && {
|
||||||
periodic_indexing_enabled: true,
|
periodic_indexing_enabled: true,
|
||||||
indexing_frequency_minutes: frequency,
|
indexing_frequency_minutes: frequency,
|
||||||
|
|
@ -940,7 +935,6 @@ export const useConnectorDialog = () => {
|
||||||
updateConnector,
|
updateConnector,
|
||||||
periodicEnabled,
|
periodicEnabled,
|
||||||
frequencyMinutes,
|
frequencyMinutes,
|
||||||
enableSummary,
|
|
||||||
enableVisionLlm,
|
enableVisionLlm,
|
||||||
indexingConnectorConfig,
|
indexingConnectorConfig,
|
||||||
setIsOpen,
|
setIsOpen,
|
||||||
|
|
@ -1005,7 +999,6 @@ export const useConnectorDialog = () => {
|
||||||
setConnectorName(connector.name);
|
setConnectorName(connector.name);
|
||||||
setPeriodicEnabled(!connector.is_indexable ? false : connector.periodic_indexing_enabled);
|
setPeriodicEnabled(!connector.is_indexable ? false : connector.periodic_indexing_enabled);
|
||||||
setFrequencyMinutes(connector.indexing_frequency_minutes?.toString() || "1440");
|
setFrequencyMinutes(connector.indexing_frequency_minutes?.toString() || "1440");
|
||||||
setEnableSummary(connector.enable_summary ?? false);
|
|
||||||
setEnableVisionLlm(connector.enable_vision_llm ?? false);
|
setEnableVisionLlm(connector.enable_vision_llm ?? false);
|
||||||
setStartDate(undefined);
|
setStartDate(undefined);
|
||||||
setEndDate(undefined);
|
setEndDate(undefined);
|
||||||
|
|
@ -1084,7 +1077,6 @@ export const useConnectorDialog = () => {
|
||||||
id: editingConnector.id,
|
id: editingConnector.id,
|
||||||
data: {
|
data: {
|
||||||
name: connectorName || editingConnector.name,
|
name: connectorName || editingConnector.name,
|
||||||
enable_summary: enableSummary,
|
|
||||||
enable_vision_llm: enableVisionLlm,
|
enable_vision_llm: enableVisionLlm,
|
||||||
periodic_indexing_enabled: !editingConnector.is_indexable ? false : periodicEnabled,
|
periodic_indexing_enabled: !editingConnector.is_indexable ? false : periodicEnabled,
|
||||||
indexing_frequency_minutes: !editingConnector.is_indexable ? null : frequency,
|
indexing_frequency_minutes: !editingConnector.is_indexable ? null : frequency,
|
||||||
|
|
@ -1219,7 +1211,6 @@ export const useConnectorDialog = () => {
|
||||||
updateConnector,
|
updateConnector,
|
||||||
periodicEnabled,
|
periodicEnabled,
|
||||||
frequencyMinutes,
|
frequencyMinutes,
|
||||||
enableSummary,
|
|
||||||
enableVisionLlm,
|
enableVisionLlm,
|
||||||
getFrequencyLabel,
|
getFrequencyLabel,
|
||||||
connectorConfig,
|
connectorConfig,
|
||||||
|
|
@ -1380,7 +1371,6 @@ export const useConnectorDialog = () => {
|
||||||
setEndDate(undefined);
|
setEndDate(undefined);
|
||||||
setPeriodicEnabled(false);
|
setPeriodicEnabled(false);
|
||||||
setFrequencyMinutes("1440");
|
setFrequencyMinutes("1440");
|
||||||
setEnableSummary(false);
|
|
||||||
setEnableVisionLlm(false);
|
setEnableVisionLlm(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1417,7 +1407,6 @@ export const useConnectorDialog = () => {
|
||||||
isDisconnecting,
|
isDisconnecting,
|
||||||
periodicEnabled,
|
periodicEnabled,
|
||||||
frequencyMinutes,
|
frequencyMinutes,
|
||||||
enableSummary,
|
|
||||||
enableVisionLlm,
|
enableVisionLlm,
|
||||||
searchSpaceId,
|
searchSpaceId,
|
||||||
allConnectors,
|
allConnectors,
|
||||||
|
|
@ -1432,7 +1421,6 @@ export const useConnectorDialog = () => {
|
||||||
setEndDate,
|
setEndDate,
|
||||||
setPeriodicEnabled,
|
setPeriodicEnabled,
|
||||||
setFrequencyMinutes,
|
setFrequencyMinutes,
|
||||||
setEnableSummary,
|
|
||||||
setEnableVisionLlm,
|
setEnableVisionLlm,
|
||||||
setConnectorName,
|
setConnectorName,
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,6 @@
|
||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
import { useAtomValue } from "jotai";
|
import { useAtomValue } from "jotai";
|
||||||
import { AlertTriangle } from "lucide-react";
|
|
||||||
import { useRouter } from "next/navigation";
|
|
||||||
import {
|
import {
|
||||||
createContext,
|
createContext,
|
||||||
type FC,
|
type FC,
|
||||||
|
|
@ -12,14 +10,8 @@ import {
|
||||||
useRef,
|
useRef,
|
||||||
useState,
|
useState,
|
||||||
} from "react";
|
} 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 { activeSearchSpaceIdAtom } from "@/atoms/search-spaces/search-space-query.atoms";
|
||||||
import { DocumentUploadTab } from "@/components/sources/DocumentUploadTab";
|
import { DocumentUploadTab } from "@/components/sources/DocumentUploadTab";
|
||||||
import { Alert, AlertDescription, AlertTitle } from "@/components/ui/alert";
|
|
||||||
import { Button } from "@/components/ui/button";
|
|
||||||
import {
|
import {
|
||||||
Dialog,
|
Dialog,
|
||||||
DialogContent,
|
DialogContent,
|
||||||
|
|
@ -98,12 +90,7 @@ const DocumentUploadPopupContent: FC<{
|
||||||
isOpen: boolean;
|
isOpen: boolean;
|
||||||
onOpenChange: (open: boolean) => void;
|
onOpenChange: (open: boolean) => void;
|
||||||
}> = ({ isOpen, onOpenChange }) => {
|
}> = ({ isOpen, onOpenChange }) => {
|
||||||
const router = useRouter();
|
|
||||||
const searchSpaceId = useAtomValue(activeSearchSpaceIdAtom);
|
const searchSpaceId = useAtomValue(activeSearchSpaceIdAtom);
|
||||||
const { data: preferences = {}, isFetching: preferencesLoading } =
|
|
||||||
useAtomValue(llmPreferencesAtom);
|
|
||||||
const { data: globalConfigs = [], isFetching: globalConfigsLoading } =
|
|
||||||
useAtomValue(globalNewLLMConfigsAtom);
|
|
||||||
|
|
||||||
if (!searchSpaceId) return null;
|
if (!searchSpaceId) return null;
|
||||||
|
|
||||||
|
|
@ -111,22 +98,6 @@ const DocumentUploadPopupContent: FC<{
|
||||||
onOpenChange(false);
|
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 (
|
return (
|
||||||
<Dialog open={isOpen} onOpenChange={onOpenChange}>
|
<Dialog open={isOpen} onOpenChange={onOpenChange}>
|
||||||
<DialogContent
|
<DialogContent
|
||||||
|
|
@ -146,33 +117,7 @@ const DocumentUploadPopupContent: FC<{
|
||||||
</DialogHeader>
|
</DialogHeader>
|
||||||
|
|
||||||
<div className="px-4 sm:px-6 pb-4 sm:pb-6">
|
<div className="px-4 sm:px-6 pb-4 sm:pb-6">
|
||||||
{!isLoading && !hasDocumentSummaryLLM ? (
|
<DocumentUploadTab searchSpaceId={searchSpaceId} onSuccess={handleSuccess} />
|
||||||
<div className="mb-4">
|
|
||||||
<Alert variant="warning">
|
|
||||||
<AlertTriangle />
|
|
||||||
<AlertTitle>LLM Configuration Required</AlertTitle>
|
|
||||||
<AlertDescription>
|
|
||||||
<p>
|
|
||||||
{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"}
|
|
||||||
</p>
|
|
||||||
<Button
|
|
||||||
size="sm"
|
|
||||||
variant="secondary"
|
|
||||||
onClick={() => {
|
|
||||||
onOpenChange(false);
|
|
||||||
router.push(`/dashboard/${searchSpaceId}/search-space-settings/models`);
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
Go to Settings
|
|
||||||
</Button>
|
|
||||||
</AlertDescription>
|
|
||||||
</Alert>
|
|
||||||
</div>
|
|
||||||
) : (
|
|
||||||
<DocumentUploadTab searchSpaceId={searchSpaceId} onSuccess={handleSuccess} />
|
|
||||||
)}
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</DialogContent>
|
</DialogContent>
|
||||||
|
|
|
||||||
|
|
@ -619,7 +619,6 @@ function AuthenticatedDocumentsSidebarBase({
|
||||||
searchSpaceId,
|
searchSpaceId,
|
||||||
excludePatterns: matched.excludePatterns ?? DEFAULT_EXCLUDE_PATTERNS,
|
excludePatterns: matched.excludePatterns ?? DEFAULT_EXCLUDE_PATTERNS,
|
||||||
fileExtensions: matched.fileExtensions ?? Array.from(getSupportedExtensionsSet()),
|
fileExtensions: matched.fileExtensions ?? Array.from(getSupportedExtensionsSet()),
|
||||||
enableSummary: false,
|
|
||||||
rootFolderId: folder.id,
|
rootFolderId: folder.id,
|
||||||
});
|
});
|
||||||
toast.success(`Re-scan complete: ${matched.name}`);
|
toast.success(`Re-scan complete: ${matched.name}`);
|
||||||
|
|
|
||||||
|
|
@ -55,15 +55,6 @@ const ROLE_DESCRIPTIONS = {
|
||||||
prefKey: "agent_llm_id" as const,
|
prefKey: "agent_llm_id" as const,
|
||||||
configType: "llm" 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: {
|
image_generation: {
|
||||||
icon: ImageIcon,
|
icon: ImageIcon,
|
||||||
title: "Image Generation Model",
|
title: "Image Generation Model",
|
||||||
|
|
@ -137,7 +128,6 @@ export function LLMRoleManager({ searchSpaceId }: LLMRoleManagerProps) {
|
||||||
|
|
||||||
const [assignments, setAssignments] = useState<Record<string, number | null>>(() => ({
|
const [assignments, setAssignments] = useState<Record<string, number | null>>(() => ({
|
||||||
agent_llm_id: preferences.agent_llm_id ?? null,
|
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,
|
vision_llm_config_id: preferences.vision_llm_config_id ?? null,
|
||||||
}));
|
}));
|
||||||
|
|
@ -148,13 +138,11 @@ export function LLMRoleManager({ searchSpaceId }: LLMRoleManagerProps) {
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
setAssignments({
|
setAssignments({
|
||||||
agent_llm_id: preferences.agent_llm_id ?? null,
|
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,
|
vision_llm_config_id: preferences.vision_llm_config_id ?? null,
|
||||||
});
|
});
|
||||||
}, [
|
}, [
|
||||||
preferences.agent_llm_id,
|
preferences.agent_llm_id,
|
||||||
preferences.document_summary_llm_id,
|
|
||||||
preferences.image_generation_config_id,
|
preferences.image_generation_config_id,
|
||||||
preferences.vision_llm_config_id,
|
preferences.vision_llm_config_id,
|
||||||
]);
|
]);
|
||||||
|
|
|
||||||
|
|
@ -139,7 +139,6 @@ export function DocumentUploadTab({
|
||||||
const [files, setFiles] = useState<FileWithId[]>([]);
|
const [files, setFiles] = useState<FileWithId[]>([]);
|
||||||
const [uploadProgress, setUploadProgress] = useState(0);
|
const [uploadProgress, setUploadProgress] = useState(0);
|
||||||
const [accordionValue, setAccordionValue] = useState<string>("");
|
const [accordionValue, setAccordionValue] = useState<string>("");
|
||||||
const [shouldSummarize, setShouldSummarize] = useState(false);
|
|
||||||
const [useVisionLlm, setUseVisionLlm] = useState(false);
|
const [useVisionLlm, setUseVisionLlm] = useState(false);
|
||||||
const [processingMode, setProcessingMode] = useState<ProcessingMode>("basic");
|
const [processingMode, setProcessingMode] = useState<ProcessingMode>("basic");
|
||||||
const [uploadDocumentMutation] = useAtom(uploadDocumentMutationAtom);
|
const [uploadDocumentMutation] = useAtom(uploadDocumentMutationAtom);
|
||||||
|
|
@ -366,7 +365,6 @@ export function DocumentUploadTab({
|
||||||
search_space_id: Number(searchSpaceId),
|
search_space_id: Number(searchSpaceId),
|
||||||
relative_paths: batch.map((e) => e.relativePath),
|
relative_paths: batch.map((e) => e.relativePath),
|
||||||
root_folder_id: rootFolderId,
|
root_folder_id: rootFolderId,
|
||||||
enable_summary: shouldSummarize,
|
|
||||||
use_vision_llm: useVisionLlm,
|
use_vision_llm: useVisionLlm,
|
||||||
processing_mode: processingMode,
|
processing_mode: processingMode,
|
||||||
}
|
}
|
||||||
|
|
@ -414,7 +412,6 @@ export function DocumentUploadTab({
|
||||||
{
|
{
|
||||||
files: rawFiles,
|
files: rawFiles,
|
||||||
search_space_id: Number(searchSpaceId),
|
search_space_id: Number(searchSpaceId),
|
||||||
should_summarize: shouldSummarize,
|
|
||||||
use_vision_llm: useVisionLlm,
|
use_vision_llm: useVisionLlm,
|
||||||
processing_mode: processingMode,
|
processing_mode: processingMode,
|
||||||
},
|
},
|
||||||
|
|
@ -696,15 +693,6 @@ export function DocumentUploadTab({
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
<div className={toggleRowClass}>
|
|
||||||
<div className="space-y-0.5">
|
|
||||||
<p className="font-medium text-sm">Enable AI Summary</p>
|
|
||||||
<p className="text-xs text-muted-foreground">
|
|
||||||
Improves search quality but adds latency
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
<Switch checked={shouldSummarize} onCheckedChange={setShouldSummarize} />
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className={toggleRowClass}>
|
<div className={toggleRowClass}>
|
||||||
<div className="space-y-0.5">
|
<div className="space-y-0.5">
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,6 @@ import {
|
||||||
DialogTitle,
|
DialogTitle,
|
||||||
} from "@/components/ui/dialog";
|
} from "@/components/ui/dialog";
|
||||||
import { Spinner } from "@/components/ui/spinner";
|
import { Spinner } from "@/components/ui/spinner";
|
||||||
import { Switch } from "@/components/ui/switch";
|
|
||||||
import { type FolderSyncProgress, uploadFolderScan } from "@/lib/folder-sync-upload";
|
import { type FolderSyncProgress, uploadFolderScan } from "@/lib/folder-sync-upload";
|
||||||
import { getSupportedExtensionsSet } from "@/lib/supported-extensions";
|
import { getSupportedExtensionsSet } from "@/lib/supported-extensions";
|
||||||
|
|
||||||
|
|
@ -46,7 +45,6 @@ export function FolderWatchDialog({
|
||||||
initialFolder,
|
initialFolder,
|
||||||
}: FolderWatchDialogProps) {
|
}: FolderWatchDialogProps) {
|
||||||
const [selectedFolder, setSelectedFolder] = useState<SelectedFolder | null>(null);
|
const [selectedFolder, setSelectedFolder] = useState<SelectedFolder | null>(null);
|
||||||
const [shouldSummarize, setShouldSummarize] = useState(false);
|
|
||||||
const [submitting, setSubmitting] = useState(false);
|
const [submitting, setSubmitting] = useState(false);
|
||||||
const [progress, setProgress] = useState<FolderSyncProgress | null>(null);
|
const [progress, setProgress] = useState<FolderSyncProgress | null>(null);
|
||||||
const abortRef = useRef<AbortController | null>(null);
|
const abortRef = useRef<AbortController | null>(null);
|
||||||
|
|
@ -91,7 +89,6 @@ export function FolderWatchDialog({
|
||||||
searchSpaceId,
|
searchSpaceId,
|
||||||
excludePatterns: DEFAULT_EXCLUDE_PATTERNS,
|
excludePatterns: DEFAULT_EXCLUDE_PATTERNS,
|
||||||
fileExtensions: supportedExtensions,
|
fileExtensions: supportedExtensions,
|
||||||
enableSummary: shouldSummarize,
|
|
||||||
onProgress: setProgress,
|
onProgress: setProgress,
|
||||||
signal: controller.signal,
|
signal: controller.signal,
|
||||||
});
|
});
|
||||||
|
|
@ -108,7 +105,6 @@ export function FolderWatchDialog({
|
||||||
|
|
||||||
toast.success(`Watching folder: ${selectedFolder.name}`);
|
toast.success(`Watching folder: ${selectedFolder.name}`);
|
||||||
setSelectedFolder(null);
|
setSelectedFolder(null);
|
||||||
setShouldSummarize(false);
|
|
||||||
setProgress(null);
|
setProgress(null);
|
||||||
onOpenChange(false);
|
onOpenChange(false);
|
||||||
onSuccess?.();
|
onSuccess?.();
|
||||||
|
|
@ -126,7 +122,6 @@ export function FolderWatchDialog({
|
||||||
}, [
|
}, [
|
||||||
selectedFolder,
|
selectedFolder,
|
||||||
searchSpaceId,
|
searchSpaceId,
|
||||||
shouldSummarize,
|
|
||||||
supportedExtensions,
|
supportedExtensions,
|
||||||
onOpenChange,
|
onOpenChange,
|
||||||
onSuccess,
|
onSuccess,
|
||||||
|
|
@ -136,8 +131,7 @@ export function FolderWatchDialog({
|
||||||
(nextOpen: boolean) => {
|
(nextOpen: boolean) => {
|
||||||
if (!nextOpen && !submitting) {
|
if (!nextOpen && !submitting) {
|
||||||
setSelectedFolder(null);
|
setSelectedFolder(null);
|
||||||
setShouldSummarize(false);
|
setProgress(null);
|
||||||
setProgress(null);
|
|
||||||
}
|
}
|
||||||
onOpenChange(nextOpen);
|
onOpenChange(nextOpen);
|
||||||
},
|
},
|
||||||
|
|
@ -206,15 +200,6 @@ export function FolderWatchDialog({
|
||||||
|
|
||||||
{selectedFolder && (
|
{selectedFolder && (
|
||||||
<>
|
<>
|
||||||
<div className="flex items-center justify-between rounded-lg bg-slate-400/5 dark:bg-white/5 p-3">
|
|
||||||
<div className="space-y-0.5">
|
|
||||||
<p className="font-medium text-sm">Enable AI Summary</p>
|
|
||||||
<p className="text-xs text-muted-foreground">
|
|
||||||
Improves search quality but adds latency
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
<Switch checked={shouldSummarize} onCheckedChange={setShouldSummarize} />
|
|
||||||
</div>
|
|
||||||
|
|
||||||
{progressLabel && (
|
{progressLabel && (
|
||||||
<div className="rounded-lg bg-slate-400/5 dark:bg-white/5 px-3 py-2">
|
<div className="rounded-lg bg-slate-400/5 dark:bg-white/5 px-3 py-2">
|
||||||
|
|
|
||||||
|
|
@ -130,7 +130,6 @@ export const processingModeEnum = z.enum(["basic", "premium"]);
|
||||||
export const uploadDocumentRequest = z.object({
|
export const uploadDocumentRequest = z.object({
|
||||||
files: z.array(z.instanceof(File)),
|
files: z.array(z.instanceof(File)),
|
||||||
search_space_id: z.number(),
|
search_space_id: z.number(),
|
||||||
should_summarize: z.boolean().default(false),
|
|
||||||
use_vision_llm: z.boolean().default(false),
|
use_vision_llm: z.boolean().default(false),
|
||||||
processing_mode: processingModeEnum.default("basic"),
|
processing_mode: processingModeEnum.default("basic"),
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,6 @@ export function useConnectorsSync(searchSpaceId: number | string | null) {
|
||||||
is_active: true,
|
is_active: true,
|
||||||
last_indexed_at: c.lastIndexedAt ? new Date(c.lastIndexedAt).toISOString() : null,
|
last_indexed_at: c.lastIndexedAt ? new Date(c.lastIndexedAt).toISOString() : null,
|
||||||
config: (c.config as Record<string, unknown>) ?? {},
|
config: (c.config as Record<string, unknown>) ?? {},
|
||||||
enable_summary: c.enableSummary,
|
|
||||||
periodic_indexing_enabled: c.periodicIndexingEnabled,
|
periodic_indexing_enabled: c.periodicIndexingEnabled,
|
||||||
indexing_frequency_minutes: c.indexingFrequencyMinutes ?? null,
|
indexing_frequency_minutes: c.indexingFrequencyMinutes ?? null,
|
||||||
next_scheduled_at: c.nextScheduledAt ? new Date(c.nextScheduledAt).toISOString() : null,
|
next_scheduled_at: c.nextScheduledAt ? new Date(c.nextScheduledAt).toISOString() : null,
|
||||||
|
|
|
||||||
|
|
@ -126,8 +126,7 @@ class DocumentsApiService {
|
||||||
throw new ValidationError(`Invalid request: ${errorMessage}`);
|
throw new ValidationError(`Invalid request: ${errorMessage}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
const { files, search_space_id, should_summarize, use_vision_llm, processing_mode } =
|
const { files, search_space_id, use_vision_llm, processing_mode } = parsedRequest.data;
|
||||||
parsedRequest.data;
|
|
||||||
const UPLOAD_BATCH_SIZE = 5;
|
const UPLOAD_BATCH_SIZE = 5;
|
||||||
|
|
||||||
const batches: File[][] = [];
|
const batches: File[][] = [];
|
||||||
|
|
@ -145,7 +144,6 @@ class DocumentsApiService {
|
||||||
const formData = new FormData();
|
const formData = new FormData();
|
||||||
for (const file of batch) formData.append("files", file);
|
for (const file of batch) formData.append("files", file);
|
||||||
formData.append("search_space_id", String(search_space_id));
|
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("use_vision_llm", String(use_vision_llm));
|
||||||
formData.append("processing_mode", processing_mode);
|
formData.append("processing_mode", processing_mode);
|
||||||
|
|
||||||
|
|
@ -420,7 +418,6 @@ class DocumentsApiService {
|
||||||
search_space_id: number;
|
search_space_id: number;
|
||||||
relative_paths: string[];
|
relative_paths: string[];
|
||||||
root_folder_id?: number | null;
|
root_folder_id?: number | null;
|
||||||
enable_summary?: boolean;
|
|
||||||
use_vision_llm?: boolean;
|
use_vision_llm?: boolean;
|
||||||
processing_mode?: "basic" | "premium";
|
processing_mode?: "basic" | "premium";
|
||||||
},
|
},
|
||||||
|
|
@ -436,7 +433,6 @@ class DocumentsApiService {
|
||||||
if (metadata.root_folder_id != null) {
|
if (metadata.root_folder_id != null) {
|
||||||
formData.append("root_folder_id", String(metadata.root_folder_id));
|
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("use_vision_llm", String(metadata.use_vision_llm ?? false));
|
||||||
formData.append("processing_mode", metadata.processing_mode ?? "basic");
|
formData.append("processing_mode", metadata.processing_mode ?? "basic");
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,6 @@ export interface FolderSyncParams {
|
||||||
searchSpaceId: number;
|
searchSpaceId: number;
|
||||||
excludePatterns: string[];
|
excludePatterns: string[];
|
||||||
fileExtensions: string[];
|
fileExtensions: string[];
|
||||||
enableSummary: boolean;
|
|
||||||
processingMode?: "basic" | "premium";
|
processingMode?: "basic" | "premium";
|
||||||
rootFolderId?: number | null;
|
rootFolderId?: number | null;
|
||||||
onProgress?: (progress: FolderSyncProgress) => void;
|
onProgress?: (progress: FolderSyncProgress) => void;
|
||||||
|
|
@ -62,8 +61,7 @@ async function uploadBatchesWithConcurrency(
|
||||||
folderName: string;
|
folderName: string;
|
||||||
searchSpaceId: number;
|
searchSpaceId: number;
|
||||||
rootFolderId: number | null;
|
rootFolderId: number | null;
|
||||||
enableSummary: boolean;
|
processingMode?: "basic" | "premium";
|
||||||
processingMode?: "basic" | "premium";
|
|
||||||
signal?: AbortSignal;
|
signal?: AbortSignal;
|
||||||
onBatchComplete?: (filesInBatch: number) => void;
|
onBatchComplete?: (filesInBatch: number) => void;
|
||||||
}
|
}
|
||||||
|
|
@ -100,7 +98,6 @@ async function uploadBatchesWithConcurrency(
|
||||||
search_space_id: params.searchSpaceId,
|
search_space_id: params.searchSpaceId,
|
||||||
relative_paths: batch.map((e) => e.relativePath),
|
relative_paths: batch.map((e) => e.relativePath),
|
||||||
root_folder_id: resolvedRootFolderId,
|
root_folder_id: resolvedRootFolderId,
|
||||||
enable_summary: params.enableSummary,
|
|
||||||
processing_mode: params.processingMode,
|
processing_mode: params.processingMode,
|
||||||
},
|
},
|
||||||
params.signal
|
params.signal
|
||||||
|
|
@ -147,7 +144,6 @@ export async function uploadFolderScan(params: FolderSyncParams): Promise<number
|
||||||
searchSpaceId,
|
searchSpaceId,
|
||||||
excludePatterns,
|
excludePatterns,
|
||||||
fileExtensions,
|
fileExtensions,
|
||||||
enableSummary,
|
|
||||||
processingMode,
|
processingMode,
|
||||||
signal,
|
signal,
|
||||||
} = params;
|
} = params;
|
||||||
|
|
@ -193,8 +189,7 @@ export async function uploadFolderScan(params: FolderSyncParams): Promise<number
|
||||||
folderName,
|
folderName,
|
||||||
searchSpaceId,
|
searchSpaceId,
|
||||||
rootFolderId: rootFolderId ?? null,
|
rootFolderId: rootFolderId ?? null,
|
||||||
enableSummary,
|
processingMode,
|
||||||
processingMode,
|
|
||||||
signal,
|
signal,
|
||||||
onBatchComplete: (count) => {
|
onBatchComplete: (count) => {
|
||||||
uploaded += count;
|
uploaded += count;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue