(step chatloop.PersistedStep)
| 111 | } |
| 112 | |
| 113 | func extractAdvisorText(step chatloop.PersistedStep) string { |
| 114 | parts := make([]string, 0, len(step.Content)) |
| 115 | for _, content := range step.Content { |
| 116 | text, ok := fantasy.AsContentType[fantasy.TextContent](content) |
| 117 | if !ok { |
| 118 | continue |
| 119 | } |
| 120 | trimmed := strings.TrimSpace(text.Text) |
| 121 | if trimmed == "" { |
| 122 | continue |
| 123 | } |
| 124 | parts = append(parts, trimmed) |
| 125 | } |
| 126 | return strings.TrimSpace(strings.Join(parts, "\n\n")) |
| 127 | } |