Arcana::AI::Chat::History
Manages a rolling conversation history with size limits.
Constants
MAX_CONTENT_CHARS = 100000
Constructors
new
SourceInstance methods
empty?
Sourcemessages
Sourcesize
Sourcetrim_if_needed
Trim middle messages to stay under MAX_CONTENT_CHARS. Keeps system (0), first user+assistant (1-2), and newest messages. Always removes tool_use/tool_result pairs together to maintain the pairing required by the Anthropic API.