mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-05-23 19:05:16 +02:00
feat: add SurfSense docs mention support in chat
This commit is contained in:
parent
1b5f29afcc
commit
cd3677b5fa
11 changed files with 226 additions and 141 deletions
|
|
@ -1,19 +1,25 @@
|
|||
"use client";
|
||||
|
||||
import { atom } from "jotai";
|
||||
import type { Document } from "@/contracts/types/document.types";
|
||||
import type { Document, SurfsenseDocsDocument } from "@/contracts/types/document.types";
|
||||
|
||||
/**
|
||||
* Atom to store the IDs of documents mentioned in the current chat composer.
|
||||
* This is used to pass document context to the backend when sending a message.
|
||||
*/
|
||||
export const mentionedDocumentIdsAtom = atom<number[]>([]);
|
||||
export const mentionedDocumentIdsAtom = atom<{
|
||||
surfsense_doc_ids: number[];
|
||||
document_ids: number[];
|
||||
}>({
|
||||
surfsense_doc_ids: [],
|
||||
document_ids: [],
|
||||
});
|
||||
|
||||
/**
|
||||
* Atom to store the full document objects mentioned in the current chat composer.
|
||||
* This persists across component remounts.
|
||||
*/
|
||||
export const mentionedDocumentsAtom = atom<Document[]>([]);
|
||||
export const mentionedDocumentsAtom = atom<(Pick<Document, "id" | "title" | "document_type">)[]>([]);
|
||||
|
||||
/**
|
||||
* Simplified document info for display purposes
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue