feat: Enhance chat and knowledge base functionalities with multi-KB support
- Updated agentChat API to accept optional knowledge_base_ids and agent_enabled parameters. - Introduced getSession API to retrieve session details. - Modified useStream to validate knowledge_base_ids for agent-chat requests and prepare POST body accordingly. - Enhanced createKnowledgeBase API to include additional configuration options. - Refactored chat routing to remove knowledge base ID from the chat path, allowing for dynamic knowledge base selection. - Improved session management by preventing duplicate session entries in the menu store. - Updated UI components for better session handling and display. - Added context management for agent conversations to improve state persistence across sessions.
This commit is contained in:
@@ -53,6 +53,8 @@ func (s *agentService) CreateAgentEngine(
|
||||
ctx context.Context,
|
||||
config *types.AgentConfig,
|
||||
eventBus *event.EventBus,
|
||||
contextManager interfaces.ContextManager,
|
||||
sessionID string,
|
||||
) (interfaces.AgentEngine, error) {
|
||||
logger.Infof(ctx, "Creating agent engine with custom EventBus")
|
||||
|
||||
@@ -103,7 +105,7 @@ func (s *agentService) CreateAgentEngine(
|
||||
}
|
||||
}
|
||||
|
||||
// Create engine with provided EventBus
|
||||
// Create engine with provided EventBus and contextManager
|
||||
engine := agent.NewAgentEngine(
|
||||
config,
|
||||
chatModel,
|
||||
@@ -111,6 +113,8 @@ func (s *agentService) CreateAgentEngine(
|
||||
s.knowledgeBaseService,
|
||||
eventBus,
|
||||
kbInfos,
|
||||
contextManager,
|
||||
sessionID,
|
||||
)
|
||||
|
||||
return engine, nil
|
||||
|
||||
Reference in New Issue
Block a user