Documentation
¶
Overview ¶
Package livetext reads and joins the narrow transient text body Host emits.
Index ¶
Constants ¶
View Source
const MaxBytes = 2048
MaxBytes caps one text preview frame before transport encoding.
Variables ¶
This section is empty.
Functions ¶
func BoundaryLoop ¶
func BoundaryLoop(body json.RawMessage) (string, bool)
BoundaryLoop names the loop whose gapped previews a committed boundary clears. A boundary without a loop identifier clears all preview gaps.
func Join ¶
func Join(first json.RawMessage, text string) (json.RawMessage, error)
Join replaces the first body's text with the concatenation the caller checked against MaxBytes. All other public fields stay present.
func Merge ¶
func Merge(first, next json.RawMessage) (json.RawMessage, bool)
Merge joins only adjacent text for the same loop and turn within the raw cap.
Types ¶
type Delta ¶
type Delta struct {
Version int `json:"v"`
Type string `json:"type"`
SessionID string `json:"session_id"`
LoopID string `json:"loop_id"`
TurnID string `json:"turn_id"`
Chunk struct {
Type string `json:"chunk_type"`
Text string `json:"text"`
} `json:"chunk"`
}
Delta is the correlation and text content of one public TokenDelta body.
Click to show internal directories.
Click to hide internal directories.