applyCacheToSystem function
Apply cache control to a system prompt (list of system content blocks).
Implementation
List<Map<String, dynamic>> applyCacheToSystem(
List<Map<String, dynamic>> systemBlocks,
) {
if (systemBlocks.isEmpty) return systemBlocks;
final result = systemBlocks.map((b) => Map<String, dynamic>.from(b)).toList();
result.last['cache_control'] = {'type': 'ephemeral'};
return result;
}