Append adds a message and returns the new view's Init command (spinner and running-tool views use it to start the animation tick stream).
(msg *types.Message)
| 48 | // Append adds a message and returns the new view's Init command (spinner |
| 49 | // and running-tool views use it to start the animation tick stream). |
| 50 | func (t *Transcript) Append(msg *types.Message) tea.Cmd { |
| 51 | v := t.newView(msg, t.lastMsg()) |
| 52 | t.msgs = append(t.msgs, msg) |
| 53 | t.views = append(t.views, v) |
| 54 | return v.Init() |
| 55 | } |
| 56 | |
| 57 | // newView creates the right view for a message, like the message list's |
| 58 | // createToolCallView / createMessageView helpers. |