diff --git a/CHANGELOG.md b/CHANGELOG.md index 83a83f1..2e0b3d2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Change Log +## [2.1.5] + +- Add support for prompt caching for new Claude model IDs on OpenRouter (e.g. `anthropic/claude-3.5-sonnet-20240620`) + ## [2.1.4] - AWS Bedrock fixes (add missing regions, support for cross-region inference, and older Sonnet model for regions where new model is not available) diff --git a/package.json b/package.json index f00b52e..ed79817 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "claude-dev", "displayName": "Cline (prev. Claude Dev)", "description": "Autonomous coding agent right in your IDE, capable of creating/editing files, running commands, using the browser, and more with your permission every step of the way.", - "version": "2.1.4", + "version": "2.1.5", "icon": "assets/icons/icon.png", "galleryBanner": { "color": "#617A91", diff --git a/src/api/providers/openrouter.ts b/src/api/providers/openrouter.ts index 2227c3e..93bbaba 100644 --- a/src/api/providers/openrouter.ts +++ b/src/api/providers/openrouter.ts @@ -31,9 +31,19 @@ export class OpenRouterHandler implements ApiHandler { ] // prompt caching: https://openrouter.ai/docs/prompt-caching + // this is specifically for claude models (some models may 'support prompt caching' automatically without this) switch (this.getModel().id) { + case "anthropic/claude-3.5-sonnet": case "anthropic/claude-3.5-sonnet:beta": + case "anthropic/claude-3.5-sonnet-20240620": + case "anthropic/claude-3.5-sonnet-20240620:beta": + case "anthropic/claude-3-5-haiku": + case "anthropic/claude-3-5-haiku:beta": + case "anthropic/claude-3-5-haiku-20241022": + case "anthropic/claude-3-5-haiku-20241022:beta": + case "anthropic/claude-3-haiku": case "anthropic/claude-3-haiku:beta": + case "anthropic/claude-3-opus": case "anthropic/claude-3-opus:beta": openAiMessages[0] = { role: "system", @@ -76,6 +86,12 @@ export class OpenRouterHandler implements ApiHandler { switch (this.getModel().id) { case "anthropic/claude-3.5-sonnet": case "anthropic/claude-3.5-sonnet:beta": + case "anthropic/claude-3.5-sonnet-20240620": + case "anthropic/claude-3.5-sonnet-20240620:beta": + case "anthropic/claude-3-5-haiku": + case "anthropic/claude-3-5-haiku:beta": + case "anthropic/claude-3-5-haiku-20241022": + case "anthropic/claude-3-5-haiku-20241022:beta": maxTokens = 8_192 break }