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

Function messageHasPartTypes

coderd/workspaceagents.go:2949–2962  ·  view source on GitHub ↗
(raw []byte, types ...codersdk.ChatMessagePartType)

Source from the content-addressed store, hash-verified

2947}
2948
2949func messageHasPartTypes(raw []byte, types ...codersdk.ChatMessagePartType) bool {
2950 var parts []codersdk.ChatMessagePart
2951 if err := json.Unmarshal(raw, &parts); err != nil {
2952 return false
2953 }
2954 for _, part := range parts {
2955 for _, typ := range types {
2956 if part.Type == typ {
2957 return true
2958 }
2959 }
2960 }
2961 return false
2962}
2963
2964// writeAgentChatError translates resolveAgentChat errors to HTTP
2965// responses.

Callers 1

clearAgentChatContextFunction · 0.85

Calls 1

UnmarshalMethod · 0.45

Tested by

no test coverage detected