fix: update environment configuration for debugging and logging, enhance SQLite FTS5 table management, and improve API base URL handling
This commit is contained in:
@@ -115,6 +115,7 @@ func (s *sessionService) KnowledgeQA(
|
||||
RewritePromptUser: s.cfg.Conversation.RewritePromptUser,
|
||||
WebSearchEnabled: req.WebSearchEnabled,
|
||||
WebSearchProviderID: s.resolveWebSearchProviderID(ctx, req, retrievalTenantID),
|
||||
WebSearchMaxResults: s.resolveWebSearchMaxResults(ctx, req),
|
||||
WebFetchEnabled: s.resolveWebFetchEnabled(req),
|
||||
WebFetchTopN: s.resolveWebFetchTopN(req),
|
||||
TenantID: retrievalTenantID,
|
||||
@@ -841,3 +842,16 @@ func (s *sessionService) resolveWebFetchTopN(req *types.QARequest) int {
|
||||
}
|
||||
return 3
|
||||
}
|
||||
|
||||
// resolveWebSearchMaxResults returns the max results for web search.
|
||||
// Priority: agent config > tenant default > default (10)
|
||||
func (s *sessionService) resolveWebSearchMaxResults(ctx context.Context, req *types.QARequest) int {
|
||||
if req.CustomAgent != nil && req.CustomAgent.Config.WebSearchMaxResults > 0 {
|
||||
return req.CustomAgent.Config.WebSearchMaxResults
|
||||
}
|
||||
tenantInfo, _ := types.TenantInfoFromContext(ctx)
|
||||
if tenantInfo != nil && tenantInfo.WebSearchConfig != nil && tenantInfo.WebSearchConfig.MaxResults > 0 {
|
||||
return tenantInfo.WebSearchConfig.MaxResults
|
||||
}
|
||||
return 10
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user