mirror of
https://github.com/infiniflow/ragflow.git
synced 2026-08-09 17:07:57 +08:00
Ports dataset knowledge compilation (wiki/graph/tree/mindmap) to the Go scheduler with a status contract, aligns wiki storage/retrieval with Python, sizes prompts by content_length, and resolves embedding batch size from provider capability.
27 lines
650 B
Go
27 lines
650 B
Go
package wikisearch
|
|
|
|
import "sync"
|
|
|
|
var (
|
|
svcMu sync.RWMutex
|
|
svcInst Service
|
|
)
|
|
|
|
// SetService installs the (production or test) wiki-search service singleton.
|
|
// Passing nil reverts to "not configured" (GetService returns nil), which is the
|
|
// pre-wiring state: the wiki_query tool then returns an empty result so the agent
|
|
// falls back to hybrid search.
|
|
func SetService(s Service) {
|
|
svcMu.Lock()
|
|
defer svcMu.Unlock()
|
|
svcInst = s
|
|
}
|
|
|
|
// GetService returns the installed wiki-search service. It may be nil until
|
|
// SetService is called during server bootstrap.
|
|
func GetService() Service {
|
|
svcMu.RLock()
|
|
defer svcMu.RUnlock()
|
|
return svcInst
|
|
}
|