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

Function knowledgeChunkType

cli/ctxmgr/knowledge.go:148–154  ·  view source on GitHub ↗

knowledgeChunkType derives the file-type tag from the chunk's source path so downstream formatting (code fences, digests) can hint the language.

(source string)

Source from the content-addressed store, hash-verified

146// knowledgeChunkType derives the file-type tag from the chunk's source path so
147// downstream formatting (code fences, digests) can hint the language.
148func knowledgeChunkType(source string) string {
149 ext := strings.TrimPrefix(strings.ToLower(filepath.Ext(source)), ".")
150 if ext == "" {
151 return "text"
152 }
153 return ext
154}
155
156// chunkSource recovers the source document path from a chunk's virtual path
157// ("docs/intro.md#0001" → "docs/intro.md"). Plain paths pass through, so the

Callers 1

ingestKnowledgeJSONLFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected