| 1026 | | 1026 | |
| 1027 | passedThePrefill = true; | 1027 | passedThePrefill = true; |
| 1028 | | 1028 | |
| | 1029 | // Skip system messages so they don't affect depth counting or receive cache breakpoints |
| | 1030 | if (messages[i].role === 'system') { |
| | 1031 | continue; |
| | 1032 | } |
| | 1033 | |
| 1029 | if (messages[i].role !== previousRoleName) { | 1034 | if (messages[i].role !== previousRoleName) { |
| 1030 | if (depth === cachingAtDepth || depth === cachingAtDepth + 2) { | 1035 | if (depth === cachingAtDepth || depth === cachingAtDepth + 2) { |
| 1031 | const content = messages[i].content; | 1036 | const content = messages[i].content; |