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:
@@ -764,7 +764,13 @@ func (s *sessionService) SearchKnowledge(ctx context.Context,
|
||||
func (s *sessionService) AgentQA(ctx context.Context, session *types.Session, query string, assistantMessageID string, eventBus *event.EventBus) error {
|
||||
sessionID := session.ID
|
||||
tenantID := ctx.Value(types.TenantIDContextKey).(uint)
|
||||
logger.Infof(ctx, "Start agent-based question answering, session ID: %s, tenant ID: %d, query: %s", sessionID, tenantID, query)
|
||||
sessionJSON, err := json.Marshal(session)
|
||||
if err != nil {
|
||||
logger.Errorf(ctx, "Failed to marshal session, session ID: %s, error: %v", sessionID, err)
|
||||
return fmt.Errorf("failed to marshal session: %w", err)
|
||||
}
|
||||
logger.Infof(ctx, "Start agent-based question answering, session ID: %s, tenant ID: %d, query: %s, session: %s",
|
||||
sessionID, tenantID, query, string(sessionJSON))
|
||||
|
||||
// Build effective agent configuration by merging session and tenant configs
|
||||
// Session-level config: Enabled, KnowledgeBases (stored in session.AgentConfig)
|
||||
|
||||
Reference in New Issue
Block a user