MCPcopy Create free account
hub / github.com/coder/coder / hasNonEmptyType

Function hasNonEmptyType

coderd/x/chatd/chatprompt/chatprompt.go:534–541  ·  view source on GitHub ↗

hasNonEmptyType returns true if at least one part has a non-empty Type field, indicating a valid SDK parts array.

(parts []codersdk.ChatMessagePart)

Source from the content-addressed store, hash-verified

532// hasNonEmptyType returns true if at least one part has a non-empty
533// Type field, indicating a valid SDK parts array.
534func hasNonEmptyType(parts []codersdk.ChatMessagePart) bool {
535 for _, p := range parts {
536 if p.Type != "" {
537 return true
538 }
539 }
540 return false
541}
542
543// hasToolResultType returns true if at least one part has Type ==
544// ToolResult, indicating a valid SDK tool-result array.

Callers 2

parseAssistantRoleFunction · 0.85
parseUserRoleFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected