extractTextFromMessage extracts text from a direct A2A Message response.
(message *a2atype.Message)
| 517 | |
| 518 | // extractTextFromMessage extracts text from a direct A2A Message response. |
| 519 | func 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 | } |
no test coverage detected