fix: 修复并行搜索中WebSearchStateService缺失问题
This commit is contained in:
@@ -491,7 +491,7 @@ func (p *PluginSearch) tryDirectChunkLoading(ctx context.Context, tenantID uint6
|
|||||||
|
|
||||||
// searchWebIfEnabled executes web search when enabled and returns converted results
|
// searchWebIfEnabled executes web search when enabled and returns converted results
|
||||||
func (p *PluginSearch) searchWebIfEnabled(ctx context.Context, chatManage *types.ChatManage) []*types.SearchResult {
|
func (p *PluginSearch) searchWebIfEnabled(ctx context.Context, chatManage *types.ChatManage) []*types.SearchResult {
|
||||||
if !chatManage.WebSearchEnabled || p.webSearchService == nil || p.tenantService == nil || chatManage.TenantID <= 0 {
|
if !chatManage.WebSearchEnabled || p.webSearchService == nil || p.tenantService == nil {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
tenant := ctx.Value(types.TenantInfoContextKey).(*types.Tenant)
|
tenant := ctx.Value(types.TenantInfoContextKey).(*types.Tenant)
|
||||||
|
|||||||
@@ -40,19 +40,21 @@ func NewPluginSearchParallel(
|
|||||||
webSearchService interfaces.WebSearchService,
|
webSearchService interfaces.WebSearchService,
|
||||||
tenantService interfaces.TenantService,
|
tenantService interfaces.TenantService,
|
||||||
sessionService interfaces.SessionService,
|
sessionService interfaces.SessionService,
|
||||||
|
webSearchStateService interfaces.WebSearchStateService,
|
||||||
graphRepository interfaces.RetrieveGraphRepository,
|
graphRepository interfaces.RetrieveGraphRepository,
|
||||||
chunkRepository interfaces.ChunkRepository,
|
chunkRepository interfaces.ChunkRepository,
|
||||||
knowledgeRepository interfaces.KnowledgeRepository,
|
knowledgeRepository interfaces.KnowledgeRepository,
|
||||||
) *PluginSearchParallel {
|
) *PluginSearchParallel {
|
||||||
// Create internal plugins without registering them
|
// Create internal plugins without registering them
|
||||||
searchPlugin := &PluginSearch{
|
searchPlugin := &PluginSearch{
|
||||||
knowledgeBaseService: knowledgeBaseService,
|
knowledgeBaseService: knowledgeBaseService,
|
||||||
knowledgeService: knowledgeService,
|
knowledgeService: knowledgeService,
|
||||||
chunkService: chunkService,
|
chunkService: chunkService,
|
||||||
config: config,
|
config: config,
|
||||||
webSearchService: webSearchService,
|
webSearchService: webSearchService,
|
||||||
tenantService: tenantService,
|
tenantService: tenantService,
|
||||||
sessionService: sessionService,
|
sessionService: sessionService,
|
||||||
|
webSearchStateService: webSearchStateService,
|
||||||
}
|
}
|
||||||
|
|
||||||
searchEntityPlugin := &PluginSearchEntity{
|
searchEntityPlugin := &PluginSearchEntity{
|
||||||
|
|||||||
Reference in New Issue
Block a user