Fix OpenRouter caching at depth with null model selection

dbc78c1c420fd2a2c8ae0bb8a9c31a28911f5dbd

Cohee <18619528+Cohee1207@users.noreply.github.com>

1 files changed, +1 -1Showing whitespace changes
src/endpoints/backends/chat-completions.js+1 -1
@@ -891,7 +891,7 @@ router.post('/generate', jsonParser, function (request, response) {
891 }891 }
892892
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) {