(systemPrompt: SystemPrompt)
| 279 | * (see https://console.statsig.com/4aF3Ewatb6xPVpCwxb5nA3/dynamic_configs/claude_cli_system_prompt_prefixes) |
| 280 | */ |
| 281 | export function logAPIPrefix(systemPrompt: SystemPrompt): void { |
| 282 | const [firstSyspromptBlock] = splitSysPromptPrefix(systemPrompt) |
| 283 | const firstSystemPrompt = firstSyspromptBlock?.text |
| 284 | logEvent('tengu_sysprompt_block', { |
| 285 | snippet: firstSystemPrompt?.slice( |
| 286 | 0, |
| 287 | 20, |
| 288 | ) as AnalyticsMetadata_I_VERIFIED_THIS_IS_NOT_CODE_OR_FILEPATHS, |
| 289 | length: firstSystemPrompt?.length ?? 0, |
| 290 | hash: (firstSystemPrompt |
| 291 | ? createHash('sha256').update(firstSystemPrompt).digest('hex') |
| 292 | : '') as AnalyticsMetadata_I_VERIFIED_THIS_IS_NOT_CODE_OR_FILEPATHS, |
| 293 | }) |
| 294 | } |
| 295 | |
| 296 | /** |
| 297 | * Split system prompt blocks by content type for API matching and cache control. |
no test coverage detected