mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-06-08 20:25:19 +02:00
add mentionedSurfsenseDoc atoms
This commit is contained in:
parent
5ecdfae8a9
commit
1b5f29afcc
1 changed files with 32 additions and 0 deletions
32
surfsense_web/atoms/chat/mentioned-surfsense-docs.atom.ts
Normal file
32
surfsense_web/atoms/chat/mentioned-surfsense-docs.atom.ts
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
"use client";
|
||||
|
||||
import { atom } from "jotai";
|
||||
import type { SurfsenseDocsDocument } from "@/contracts/types/document.types";
|
||||
|
||||
/**
|
||||
* Atom to store the IDs of SurfSense docs mentioned in the current chat composer.
|
||||
* This is used to pass documentation context to the backend when sending a message.
|
||||
*/
|
||||
export const mentionedSurfsenseDocIdsAtom = atom<number[]>([]);
|
||||
|
||||
/**
|
||||
* Atom to store the full SurfSense doc objects mentioned in the current chat composer.
|
||||
* This persists across component remounts.
|
||||
*/
|
||||
export const mentionedSurfsenseDocsAtom = atom<SurfsenseDocsDocument[]>([]);
|
||||
|
||||
/**
|
||||
* Simplified SurfSense doc info for display purposes
|
||||
*/
|
||||
export interface MentionedSurfsenseDocInfo {
|
||||
id: number;
|
||||
title: string;
|
||||
source: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* Atom to store mentioned SurfSense docs per message ID.
|
||||
* This allows displaying which docs were mentioned with each user message.
|
||||
*/
|
||||
export const messageSurfsenseDocsMapAtom = atom<Record<string, MentionedSurfsenseDocInfo[]>>({});
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue