mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-07-04 22:02:16 +02:00
feat(chat): persist referenced-chat mention chips on user turns
Recognise the "thread" chip kind when building stored user content so referenced-chat mentions survive reloads and regeneration.
This commit is contained in:
parent
857f1bb279
commit
0e5ce83ee5
1 changed files with 7 additions and 2 deletions
|
|
@ -109,7 +109,8 @@ def _build_user_content(
|
||||||
[{"type": "text", "text": "..."},
|
[{"type": "text", "text": "..."},
|
||||||
{"type": "image", "image": "data:..."},
|
{"type": "image", "image": "data:..."},
|
||||||
{"type": "mentioned-documents", "documents": [{"id": int,
|
{"type": "mentioned-documents", "documents": [{"id": int,
|
||||||
"title": str, "kind": "doc" | "folder" | "connector", ...},
|
"title": str, "kind": "doc" | "folder" | "connector" | "thread",
|
||||||
|
...},
|
||||||
...]}]
|
...]}]
|
||||||
|
|
||||||
The companion reader is
|
The companion reader is
|
||||||
|
|
@ -135,7 +136,11 @@ def _build_user_content(
|
||||||
title = doc.get("title")
|
title = doc.get("title")
|
||||||
document_type = doc.get("document_type")
|
document_type = doc.get("document_type")
|
||||||
kind_raw = doc.get("kind", "doc")
|
kind_raw = doc.get("kind", "doc")
|
||||||
kind = kind_raw if kind_raw in ("doc", "folder", "connector") else "doc"
|
kind = (
|
||||||
|
kind_raw
|
||||||
|
if kind_raw in ("doc", "folder", "connector", "thread")
|
||||||
|
else "doc"
|
||||||
|
)
|
||||||
if doc_id is None or title is None:
|
if doc_id is None or title is None:
|
||||||
continue
|
continue
|
||||||
if kind == "doc" and document_type is None:
|
if kind == "doc" and document_type is None:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue