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

Function systemPromptText

coderd/x/chatd/chatd_internal_test.go:3537–3554  ·  view source on GitHub ↗
(t *testing.T, prompt []fantasy.Message)

Source from the content-addressed store, hash-verified

3535}
3536
3537func systemPromptText(t *testing.T, prompt []fantasy.Message) string {
3538 t.Helper()
3539
3540 var b strings.Builder
3541 for _, msg := range prompt {
3542 if msg.Role != fantasy.MessageRoleSystem {
3543 continue
3544 }
3545 for _, part := range msg.Content {
3546 textPart, ok := fantasy.AsMessagePart[fantasy.TextPart](part)
3547 if ok {
3548 _, _ = b.WriteString(textPart.Text)
3549 _, _ = b.WriteString("\n")
3550 }
3551 }
3552 }
3553 return b.String()
3554}
3555
3556func TestContextFileAgentID(t *testing.T) {
3557 t.Parallel()

Calls 3

WriteStringMethod · 0.80
HelperMethod · 0.65
StringMethod · 0.45

Tested by

no test coverage detected