| 860 | } | 860 | } |
| 861 | | 861 | |
| 862 | let cachingAtDepth = getConfigValue('claude.cachingAtDepth', -1); | 862 | let cachingAtDepth = getConfigValue('claude.cachingAtDepth', -1); |
| 863 | if (Number.isInteger(cachingAtDepth) && cachingAtDepth >= 0 && request.body.model.startsWith('anthropic/claude-3')) { | 863 | if (Number.isInteger(cachingAtDepth) && cachingAtDepth >= 0 && request.body.model?.startsWith('anthropic/claude-3')) { |
| 864 | cachingAtDepthForOpenRouterClaude(request.body.messages, cachingAtDepth); | 864 | cachingAtDepthForOpenRouterClaude(request.body.messages, cachingAtDepth); |
| 865 | } | 865 | } |
| 866 | } else if (request.body.chat_completion_source === CHAT_COMPLETION_SOURCES.CUSTOM) { | 866 | } else if (request.body.chat_completion_source === CHAT_COMPLETION_SOURCES.CUSTOM) { |