MCPcopy Index your code
hub / github.com/coder/coder / filterSkillParts

Function filterSkillParts

coderd/x/chatd/instruction.go:245–256  ·  view source on GitHub ↗

filterSkillParts returns stripped copies of skill-type parts from the given slice. Internal fields are removed so the result is safe for the cache column. Returns nil when no skill parts exist.

(parts []codersdk.ChatMessagePart)

Source from the content-addressed store, hash-verified

243// the given slice. Internal fields are removed so the result is safe
244// for the cache column. Returns nil when no skill parts exist.
245func filterSkillParts(parts []codersdk.ChatMessagePart) []codersdk.ChatMessagePart {
246 var out []codersdk.ChatMessagePart
247 for _, p := range parts {
248 if p.Type != codersdk.ChatMessagePartTypeSkill {
249 continue
250 }
251 cp := p
252 cp.StripInternal()
253 out = append(out, cp)
254 }
255 return out
256}

Callers 1

Calls 1

StripInternalMethod · 0.80

Tested by

no test coverage detected