feat: add web search option to AgentQA functionality
- Introduced a new parameter `webSearchEnabled` to the `AgentQA` method, allowing for conditional web search capabilities. - Updated the session service interface and handler to accommodate the new parameter, enhancing the flexibility of the AgentQA process. - Adjusted the configuration to ensure that web search functionality can be toggled based on the provided input. These changes improve the AgentQA feature by enabling users to control web search integration, enhancing the overall user experience.
This commit is contained in:
@@ -1371,6 +1371,7 @@ func (s *sessionService) AgentQA(
|
||||
knowledgeBaseIDs []string,
|
||||
knowledgeIDs []string,
|
||||
imageURLs []string, imageDescription string, userMessageID string,
|
||||
webSearchEnabled bool,
|
||||
) error {
|
||||
_ = userMessageID // reserved for future use (AgentQA pipeline differs from KnowledgeQA)
|
||||
sessionID := session.ID
|
||||
@@ -1421,7 +1422,7 @@ func (s *sessionService) AgentQA(
|
||||
MaxIterations: customAgent.Config.MaxIterations,
|
||||
ReflectionEnabled: customAgent.Config.ReflectionEnabled,
|
||||
Temperature: customAgent.Config.Temperature,
|
||||
WebSearchEnabled: customAgent.Config.WebSearchEnabled,
|
||||
WebSearchEnabled: customAgent.Config.WebSearchEnabled && webSearchEnabled,
|
||||
WebSearchMaxResults: customAgent.Config.WebSearchMaxResults,
|
||||
MultiTurnEnabled: customAgent.Config.MultiTurnEnabled,
|
||||
HistoryTurns: customAgent.Config.HistoryTurns,
|
||||
|
||||
@@ -654,6 +654,7 @@ func (h *Handler) executeAgentModeQA(reqCtx *qaRequestContext) {
|
||||
reqCtx.knowledgeIDs,
|
||||
imageURLs, imageDescription,
|
||||
reqCtx.userMessageID,
|
||||
reqCtx.webSearchEnabled,
|
||||
)
|
||||
if err != nil {
|
||||
logger.ErrorWithFields(streamCtx.asyncCtx, err, nil)
|
||||
|
||||
@@ -67,6 +67,7 @@ type SessionService interface {
|
||||
knowledgeBaseIDs []string,
|
||||
knowledgeIDs []string,
|
||||
imageURLs []string, imageDescription string, userMessageID string,
|
||||
webSearchEnabled bool,
|
||||
) error
|
||||
// ClearContext clears the LLM context for a session
|
||||
ClearContext(ctx context.Context, sessionID string) error
|
||||
|
||||
Reference in New Issue
Block a user