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

Function validContextMode

cli/context_adapter.go:56–71  ·  view source on GitHub ↗

validContextMode keeps the model from creating a context in a bogus mode.

(mode string)

Source from the content-addressed store, hash-verified

54
55// validContextMode keeps the model from creating a context in a bogus mode.
56func validContextMode(mode string) (ctxmgr.ProcessingMode, bool) {
57 switch ctxmgr.ProcessingMode(strings.ToLower(strings.TrimSpace(mode))) {
58 case ctxmgr.ModeFull:
59 return ctxmgr.ModeFull, true
60 case ctxmgr.ModeSummary:
61 return ctxmgr.ModeSummary, true
62 case ctxmgr.ModeChunked:
63 return ctxmgr.ModeChunked, true
64 case ctxmgr.ModeSmart:
65 return ctxmgr.ModeSmart, true
66 case ctxmgr.ModeKnowledge, "":
67 return ctxmgr.ModeKnowledge, true
68 default:
69 return "", false
70 }
71}
72
73// Create builds and persists a context from the given sources.
74func (a *contextPluginAdapter) Create(name, mode string, paths []string, description string, force bool) (string, error) {

Callers 2

CreateMethod · 0.85
UpdateMethod · 0.85

Calls 1

ProcessingModeTypeAlias · 0.92

Tested by

no test coverage detected