diff options
| -rw-r--r-- | apps/web/components/dashboard/bookmarks/SummarizeBookmarkArea.tsx | 4 | ||||
| -rw-r--r-- | apps/web/lib/clientConfig.tsx | 1 | ||||
| -rw-r--r-- | packages/shared/config.ts | 3 |
3 files changed, 8 insertions, 0 deletions
diff --git a/apps/web/components/dashboard/bookmarks/SummarizeBookmarkArea.tsx b/apps/web/components/dashboard/bookmarks/SummarizeBookmarkArea.tsx index 717c98a1..b5e89a01 100644 --- a/apps/web/components/dashboard/bookmarks/SummarizeBookmarkArea.tsx +++ b/apps/web/components/dashboard/bookmarks/SummarizeBookmarkArea.tsx @@ -2,6 +2,7 @@ import React from "react"; import { ActionButton } from "@/components/ui/action-button"; import LoadingSpinner from "@/components/ui/spinner"; import { toast } from "@/components/ui/use-toast"; +import { useClientConfig } from "@/lib/clientConfig"; import { useTranslation } from "@/lib/i18n/client"; import { cn } from "@/lib/utils"; import { ChevronUp, RefreshCw, Sparkles, Trash2 } from "lucide-react"; @@ -110,12 +111,15 @@ export default function SummarizeBookmarkArea({ }, }); + const clientConfig = useClientConfig(); if (bookmark.content.type !== BookmarkTypes.LINK) { return null; } if (bookmark.summary) { return <AISummary bookmarkId={bookmark.id} summary={bookmark.summary} />; + } else if (!clientConfig.inference.isConfigured) { + return null; } else { return ( <div className="flex w-full items-center gap-4"> diff --git a/apps/web/lib/clientConfig.tsx b/apps/web/lib/clientConfig.tsx index ef8e0815..2a66de37 100644 --- a/apps/web/lib/clientConfig.tsx +++ b/apps/web/lib/clientConfig.tsx @@ -9,6 +9,7 @@ export const ClientConfigCtx = createContext<ClientConfig>({ disablePasswordAuth: false, }, inference: { + isConfigured: false, inferredTagLang: "english", }, serverVersion: undefined, diff --git a/packages/shared/config.ts b/packages/shared/config.ts index a4548348..c355f9db 100644 --- a/packages/shared/config.ts +++ b/packages/shared/config.ts @@ -187,6 +187,9 @@ export const clientConfig = { disablePasswordAuth: serverConfig.auth.disablePasswordAuth, }, inference: { + isConfigured: + !!serverConfig.inference.openAIApiKey || + !!serverConfig.inference.ollamaBaseUrl, inferredTagLang: serverConfig.inference.inferredTagLang, }, serverVersion: serverConfig.serverVersion, |
