message

package
v1.66.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 27, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(msg, previous *types.Message) *messageModel

New creates a new message view

Types

type Model

type Model interface {
	layout.Model
	layout.Sizeable
	SetMessage(msg *types.Message)
	SetSelected(selected bool)
	SetHovered(hovered bool)
	CodeBlocks() []markdown.CodeBlock
	// Finalize releases per-message render state that is only needed while the
	// message is actively streaming. The message content and code-block metadata
	// are preserved; calling View() afterwards still produces correct output
	// without retaining a per-view render cache or IncrementalRenderer.
	Finalize()
	// HasLiveRenderState reports whether this view currently retains a
	// populated renderCache or an IncrementalRenderer instance. Used by tests
	// to assert that finalized views have actually released their per-message
	// render state without reaching into unexported fields via reflection.
	HasLiveRenderState() bool
}

Model represents a view that can render a message

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL