(entries []map[string]any)
| 663 | } |
| 664 | |
| 665 | func BuildFullscreenTranscriptBlocks(entries []map[string]any) []map[string]any { |
| 666 | var blocks []map[string]any |
| 667 | for _, entry := range entries { |
| 668 | kind := stringFromAny(entry["kind"]) |
| 669 | text := stringFromAny(entry["text"]) |
| 670 | if text == "" { |
| 671 | continue |
| 672 | } |
| 673 | if kind != "user" && kind != "assistant" { |
| 674 | continue |
| 675 | } |
| 676 | if len(blocks) > 0 && kind == "assistant" && stringFromAny(blocks[len(blocks)-1]["kind"]) == kind { |
| 677 | blocks[len(blocks)-1]["text"] = stringFromAny(blocks[len(blocks)-1]["text"]) + text |
| 678 | } else { |
| 679 | blocks = append(blocks, map[string]any{"kind": kind, "text": text}) |
| 680 | } |
| 681 | } |
| 682 | return blocks |
| 683 | } |
| 684 | |
| 685 | func (b *FullscreenRendererBackend) formatTranscriptBlock(block map[string]any) string { |
| 686 | kind := stringFromAny(block["kind"]) |
no test coverage detected