MCPcopy Create free account
hub / github.com/diillson/chatcli / AttachEmbeddingProvider

Method AttachEmbeddingProvider

cli/ctxmgr/manager.go:51–55  ·  view source on GitHub ↗

AttachEmbeddingProvider wires (or rewires) the embedding provider that powers semantic /context retrieval. A Null/absent provider still yields a live engine: Enabled() stays false (so --rag attachments degrade to whole content exactly as before), while knowledge-mode hybrid retrieval keeps its keyle

(provider embedding.Provider)

Source from the content-addressed store, hash-verified

49// exactly as before), while knowledge-mode hybrid retrieval keeps its keyless
50// BM25 floor. Safe to call once at startup; provider-agnostic across backends.
51func (m *Manager) AttachEmbeddingProvider(provider embedding.Provider) {
52 m.mu.Lock()
53 defer m.mu.Unlock()
54 m.retrieval = NewRetrievalEngine(provider, m.Storage.basePath, m.logger)
55}
56
57// RetrievalEnabled reports whether a real embedding provider backs retrieval.
58func (m *Manager) RetrievalEnabled() bool {

Callers 6

newKnowledgeTestCLIFunction · 0.80
newContextTestCLIFunction · 0.80
NewChatCLIFunction · 0.80
newKnowledgeManagerFunction · 0.80

Implementers 2

MockTokenManagerllm/token/mock_token_manager.go
TokenManagerllm/token/token_manager.go

Calls 3

NewRetrievalEngineFunction · 0.85
LockMethod · 0.80
UnlockMethod · 0.80

Tested by 4

newKnowledgeTestCLIFunction · 0.64
newContextTestCLIFunction · 0.64
newKnowledgeManagerFunction · 0.64