Documentation
¶
Overview ¶
Package render provides pure rendering functions for message blocks. These functions are stateless and can be used by both streaming and historical message rendering paths, eliminating code duplication.
Index ¶
- func AssistantBlock(content string, width int, theme style.Theme) string
- func ErrorBlock(errorMsg string, ty *herald.Typography, theme style.Theme) string
- func ReasoningBlock(content string, duration int64, width int, ty *herald.Typography, ...) string
- func SystemBlock(content string, ty *herald.Typography, theme style.Theme) string
- func ToolBlock(displayName, params, body string, isError bool, width int, ...) string
- func UserBlock(content string, width int, ty *herald.Typography, theme style.Theme) string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AssistantBlock ¶
AssistantBlock renders an assistant message with markdown styling.
func ErrorBlock ¶
ErrorBlock renders an error message with herald Caution styling.
func ReasoningBlock ¶
func ReasoningBlock(content string, duration int64, width int, ty *herald.Typography, theme style.Theme) string
ReasoningBlock renders a reasoning/thinking block with muted italic text. If duration > 0, shows "Thought for Xs" label. Otherwise shows just "Thought". The width parameter controls soft-wrapping so long reasoning lines don't get cut off.
func SystemBlock ¶
SystemBlock renders a system message with herald Note styling.
func ToolBlock ¶
func ToolBlock(displayName, params, body string, isError bool, width int, ty *herald.Typography, theme style.Theme) string
ToolBlock renders a tool execution result with header and body.
Types ¶
This section is empty.