mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-05-04 13:22:41 +02:00
feat: perf optimizations
- improved search_knowledgebase_tool - Added new endpoint to batch-fetch comments for multiple messages, reducing the number of API calls. - Introduced CommentBatchRequest and CommentBatchResponse schemas for handling batch requests and responses. - Updated chat_comments_service to validate message existence and permissions before fetching comments. - Enhanced frontend with useBatchCommentsPreload hook to optimize comment loading for assistant messages.
This commit is contained in:
parent
a43956bdce
commit
0e723a5b8b
13 changed files with 424 additions and 67 deletions
|
|
@ -87,6 +87,18 @@ class CommentListResponse(BaseModel):
|
|||
total_count: int
|
||||
|
||||
|
||||
class CommentBatchRequest(BaseModel):
|
||||
"""Request for batch-fetching comments for multiple messages."""
|
||||
|
||||
message_ids: list[int] = Field(..., min_length=1, max_length=200)
|
||||
|
||||
|
||||
class CommentBatchResponse(BaseModel):
|
||||
"""Batch response keyed by message_id."""
|
||||
|
||||
comments_by_message: dict[int, CommentListResponse]
|
||||
|
||||
|
||||
# =============================================================================
|
||||
# Mention Schemas
|
||||
# =============================================================================
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue