mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-04-25 00:36:31 +02:00
Make Vision LLM opt-in for uploads and connectors
This commit is contained in:
parent
0aefcbd504
commit
a95bf58c8f
24 changed files with 276 additions and 20 deletions
|
|
@ -136,6 +136,7 @@ export function DocumentUploadTab({
|
|||
const [uploadProgress, setUploadProgress] = useState(0);
|
||||
const [accordionValue, setAccordionValue] = useState<string>("");
|
||||
const [shouldSummarize, setShouldSummarize] = useState(false);
|
||||
const [useVisionLlm, setUseVisionLlm] = useState(false);
|
||||
const [uploadDocumentMutation] = useAtom(uploadDocumentMutationAtom);
|
||||
const { mutate: uploadDocuments, isPending: isUploading } = uploadDocumentMutation;
|
||||
const fileInputRef = useRef<HTMLInputElement>(null);
|
||||
|
|
@ -361,6 +362,7 @@ export function DocumentUploadTab({
|
|||
relative_paths: batch.map((e) => e.relativePath),
|
||||
root_folder_id: rootFolderId,
|
||||
enable_summary: shouldSummarize,
|
||||
use_vision_llm: useVisionLlm,
|
||||
}
|
||||
);
|
||||
|
||||
|
|
@ -407,6 +409,7 @@ export function DocumentUploadTab({
|
|||
files: rawFiles,
|
||||
search_space_id: Number(searchSpaceId),
|
||||
should_summarize: shouldSummarize,
|
||||
use_vision_llm: useVisionLlm,
|
||||
},
|
||||
{
|
||||
onSuccess: () => {
|
||||
|
|
@ -696,6 +699,16 @@ export function DocumentUploadTab({
|
|||
<Switch checked={shouldSummarize} onCheckedChange={setShouldSummarize} />
|
||||
</div>
|
||||
|
||||
<div className={toggleRowClass}>
|
||||
<div className="space-y-0.5">
|
||||
<p className="font-medium text-sm">Enable Vision LLM</p>
|
||||
<p className="text-xs text-muted-foreground">
|
||||
Describes images using AI vision (costly, slower)
|
||||
</p>
|
||||
</div>
|
||||
<Switch checked={useVisionLlm} onCheckedChange={setUseVisionLlm} />
|
||||
</div>
|
||||
|
||||
<Button
|
||||
className="w-full"
|
||||
onClick={handleUpload}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue