feat: Add web search results handling and enhance knowledge retrieval features
- Introduced a new endpoint to fetch chunks by ID, improving access to specific knowledge base entries. - Updated tool result types to include web search results, enhancing the display capabilities in the chat component. - Enhanced the AgentStreamDisplay component to support rendering web search results with improved HTML formatting. - Implemented logic for managing web search result summaries and citations, ensuring a cohesive user experience. - Refactored session management to accommodate new web search functionalities, improving overall system integration.
This commit is contained in:
@@ -5,7 +5,6 @@ import (
|
||||
"fmt"
|
||||
"time"
|
||||
|
||||
"github.com/Tencent/WeKnora/internal/errors"
|
||||
"github.com/Tencent/WeKnora/internal/event"
|
||||
"github.com/Tencent/WeKnora/internal/logger"
|
||||
"github.com/Tencent/WeKnora/internal/types"
|
||||
@@ -139,15 +138,6 @@ func (h *Handler) writeAgentQueryEvent(ctx context.Context, sessionID, assistant
|
||||
}
|
||||
}
|
||||
|
||||
// validateSessionAndGetID validates and extracts session ID from URL parameter
|
||||
func validateSessionID(c *gin.Context) (string, error) {
|
||||
sessionID := c.Param("session_id")
|
||||
if sessionID == "" {
|
||||
return "", errors.NewBadRequestError(errors.ErrInvalidSessionID.Error())
|
||||
}
|
||||
return sessionID, nil
|
||||
}
|
||||
|
||||
// getRequestID gets the request ID from gin context
|
||||
func getRequestID(c *gin.Context) string {
|
||||
return c.GetString(types.RequestIDContextKey.String())
|
||||
|
||||
Reference in New Issue
Block a user