MCPcopy
hub / github.com/kagent-dev/kagent / extractTextFromMessage

Function extractTextFromMessage

go/adk/pkg/tools/remote_a2a_tool.go:519–530  ·  view source on GitHub ↗

extractTextFromMessage extracts text from a direct A2A Message response.

(message *a2atype.Message)

Source from the content-addressed store, hash-verified

517
518// extractTextFromMessage extracts text from a direct A2A Message response.
519func extractTextFromMessage(message *a2atype.Message) string {
520 if message == nil {
521 return ""
522 }
523 var texts []string
524 for _, part := range message.Parts {
525 if tp, ok := part.(a2atype.TextPart); ok && tp.Text != "" {
526 texts = append(texts, tp.Text)
527 }
528 }
529 return strings.Join(texts, "\n")
530}

Callers 2

processResultMethod · 0.85
extractTextFromTaskFunction · 0.85

Calls 1

JoinMethod · 0.45

Tested by

no test coverage detected