mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-05-15 18:25:18 +02:00
feat: enhance new chat functionality with document mentions support
- Updated the new chat routes to include handling for mentioned document IDs, allowing users to reference specific documents in their chat. - Modified the NewChatRequest schema to accommodate optional document IDs. - Implemented document mention formatting in the chat streaming service for improved context. - Enhanced the frontend to manage document mentions, including a new atom for state management and UI updates for document selection. - Refactored the DocumentsDataTable component for better integration with the new mention functionality.
This commit is contained in:
parent
9caaf6dee4
commit
ceb01dc544
7 changed files with 346 additions and 628 deletions
|
|
@ -686,7 +686,7 @@ async def handle_new_chat(
|
|||
search_space = search_space_result.scalars().first()
|
||||
|
||||
# TODO: Add new llm config arch then complete this
|
||||
llm_config_id = -1
|
||||
llm_config_id = -4
|
||||
|
||||
# Return streaming response
|
||||
return StreamingResponse(
|
||||
|
|
@ -698,6 +698,7 @@ async def handle_new_chat(
|
|||
llm_config_id=llm_config_id,
|
||||
messages=request.messages,
|
||||
attachments=request.attachments,
|
||||
mentioned_document_ids=request.mentioned_document_ids,
|
||||
),
|
||||
media_type="text/event-stream",
|
||||
headers={
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue