anthropicConfig method
Configure Anthropic-specific features
Implementation
MessageBuilder anthropicConfig(
void Function(AnthropicMessageBuilder) configure) {
final anthropicBuilder = AnthropicMessageBuilder._(this);
configure(anthropicBuilder);
// Store cache flag in extensions if enabled.
if (anthropicBuilder._cacheEnabled) {
// Add cache control to the message.
final cacheMarker = AnthropicTextBlock(
text: '', // Empty text
cacheControl: AnthropicCacheControl.ephemeral(
ttl: anthropicBuilder._cacheTtl?.value,
),
);
addBlock(cacheMarker);
}
return this;
}