CacheConfig class

Configuration for Anthropic prompt caching.

Constructors

CacheConfig({bool enabled = true, List<int> breakpoints = const [], int minTokensForCache = 1024})
const
CacheConfig.auto({int? messageCount})
Auto breakpoints: cache the system prompt (index -1 signals system) and the last user message.
factory

Properties

breakpoints List<int>
Indices of messages (in the messages array) whose last content block should receive a cache_control ephemeral marker. Typically the system prompt and the most recent few turns benefit most from caching.
final
enabled bool
Whether caching is enabled.
final
hashCode int
The hash code for this object.
no setterinherited
minTokensForCache int
Minimum number of tokens a cacheable prefix should have (API requires at least 1024 tokens for caching to be effective with Neomage models).
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Constants

disabled → const CacheConfig