Versions in this module Expand all Collapse all v1 v1.0.0 Feb 23, 2026 Changes in this version + type ContentBlock struct + Data string + MediaType string + Text string + Type ContentBlockType + URL string + type ContentBlockType string + const ContentBlockDocument + const ContentBlockImage + const ContentBlockText + type History struct + func NewHistory() *History + func (h *History) All() []Message + func (h *History) Append(msg Message) + func (h *History) Last() (Message, bool) + func (h *History) Len() int + func (h *History) Replace(msgs []Message) + func (h *History) Reset() + func (h *History) TokenCount() int + type Message struct + Content string + ContentBlocks []ContentBlock + ReasoningContent string + Role string + ToolCalls []ToolCall + func CloneMessage(msg Message) Message + func CloneMessages(msgs []Message) []Message + type NaiveCounter struct + func (NaiveCounter) Count(msg Message) int + type TokenCounter interface + Count func(msg Message) int + type ToolCall struct + Arguments map[string]any + ID string + Name string + Result string + type Trimmer struct + Counter TokenCounter + MaxTokens int + func NewTrimmer(limit int, counter TokenCounter) *Trimmer + func (t *Trimmer) Trim(history []Message) []Message