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

Method chatKnowledgeActive

cli/chat_knowledge.go:51–60  ·  view source on GitHub ↗

chatKnowledgeActive reports whether the exception applies to THIS turn: enabled and at least one knowledge base attached to the session. Without an attached base the chat turn stays exactly as before.

()

Source from the content-addressed store, hash-verified

49// enabled and at least one knowledge base attached to the session. Without an
50// attached base the chat turn stays exactly as before.
51func (cli *ChatCLI) chatKnowledgeActive() bool {
52 if !chatKnowledgeEnabled() || cli.contextHandler == nil {
53 return false
54 }
55 sessionID := cli.currentSessionName
56 if sessionID == "" {
57 sessionID = "default"
58 }
59 return len(cli.contextHandler.GetManager().AttachedKnowledge(sessionID)) > 0
60}
61
62// knowledgeToolDefinition is the native tool-use definition offered in the
63// chat decision turn. The parameters mirror the @knowledge JSON envelope, so

Calls 3

chatKnowledgeEnabledFunction · 0.85
AttachedKnowledgeMethod · 0.80
GetManagerMethod · 0.45