feat(web): enhance chat context and mention handling with connector support

This commit is contained in:
Anish Sarkar 2026-05-26 21:11:53 +05:30
parent 701ae800b4
commit a41b16b73e
15 changed files with 773 additions and 449 deletions

View file

@ -137,15 +137,19 @@ def _build_user_content(
if doc_id is None or title is None or document_type is None:
continue
kind_raw = doc.get("kind", "doc")
kind = kind_raw if kind_raw in ("doc", "folder") else "doc"
normalized.append(
{
"id": doc_id,
"title": str(title),
"document_type": str(document_type),
"kind": kind,
}
)
kind = kind_raw if kind_raw in ("doc", "folder", "connector") else "doc"
item = {
"id": doc_id,
"title": str(title),
"document_type": str(document_type),
"kind": kind,
}
if kind == "connector":
connector_type = doc.get("connector_type") or document_type
account_name = doc.get("account_name") or title
item["connector_type"] = str(connector_type)
item["account_name"] = str(account_name)
normalized.append(item)
if normalized:
parts.append({"type": "mentioned-documents", "documents": normalized})
return parts