| 891 | } | 891 | } |
| 892 | | 892 | |
| 893 | let cachingAtDepth = getConfigValue('claude.cachingAtDepth', -1); | 893 | let cachingAtDepth = getConfigValue('claude.cachingAtDepth', -1); |
| 894 | if (Number.isInteger(cachingAtDepth) && cachingAtDepth >= 0 && request.body.model.startsWith('anthropic/claude-3')) { | 894 | if (Number.isInteger(cachingAtDepth) && cachingAtDepth >= 0 && request.body.model?.startsWith('anthropic/claude-3')) { |
| 895 | cachingAtDepthForOpenRouterClaude(request.body.messages, cachingAtDepth); | 895 | cachingAtDepthForOpenRouterClaude(request.body.messages, cachingAtDepth); |
| 896 | } | 896 | } |
| 897 | } else if (request.body.chat_completion_source === CHAT_COMPLETION_SOURCES.CUSTOM) { | 897 | } else if (request.body.chat_completion_source === CHAT_COMPLETION_SOURCES.CUSTOM) { |