MCPcopy Create free account
hub / github.com/Quorinex/Kiro-Go / appendSystemCacheBlocks

Function appendSystemCacheBlocks

proxy/cache_tracker.go:286–317  ·  view source on GitHub ↗
(blocks *[]cacheablePromptBlock, system interface{})

Source from the content-addressed store, hash-verified

284}
285
286func appendSystemCacheBlocks(blocks *[]cacheablePromptBlock, system interface{}) {
287 switch v := system.(type) {
288 case string:
289 appendPromptBlock(blocks, map[string]interface{}{
290 "kind": "system",
291 "system_index": 0,
292 "block": map[string]interface{}{
293 "type": "text",
294 "text": v,
295 },
296 }, false)
297 case []interface{}:
298 for i, block := range v {
299 appendPromptBlock(blocks, map[string]interface{}{
300 "kind": "system",
301 "system_index": i,
302 "block": block,
303 }, false)
304 }
305 case []string:
306 for i, block := range v {
307 appendPromptBlock(blocks, map[string]interface{}{
308 "kind": "system",
309 "system_index": i,
310 "block": map[string]interface{}{
311 "type": "text",
312 "text": block,
313 },
314 }, false)
315 }
316 }
317}
318
319func appendMessageCacheBlocks(blocks *[]cacheablePromptBlock, messageIndex int, msg ClaudeMessage) {
320 role := msg.Role

Callers 1

flattenClaudeCacheBlocksFunction · 0.85

Calls 1

appendPromptBlockFunction · 0.85

Tested by

no test coverage detected