Skip to content

Commit a218aed

Browse files
committed
Update to Claude Sonnet 4
1 parent 0bc266c commit a218aed

File tree

2 files changed

+12
-22
lines changed

2 files changed

+12
-22
lines changed

src/assistant/extension.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -573,7 +573,7 @@ You can also ask me to explain the code in your Shiny app, or to help you with a
573573
) {
574574
// We get here if the model is not enabled.
575575
stream.markdown(
576-
`The requested model, ${request.model.name} is not enabled. You can enable it at [https://github.com/settings/copilot](https://github.com/settings/copilot). Scroll down to **Anthropic Claude 3.5 Sonnet in Copilot** and set it to **Enable**.\n\n`
576+
`The requested model, ${request.model.name} is not enabled. You can enable it at [https://github.com/settings/copilot](https://github.com/settings/copilot). Scroll down to **Anthropic Claude 4 Sonnet in Copilot** and set it to **Enable**.\n\n`
577577
);
578578
stream.markdown(
579579
`Or you can send another message in this chat without \`@shiny\`, like \`"Hello"\`, and Copilot will ask you if you want to enable ${request.model.name}. After you enable it, remember to start the next message with \`@shiny\` again.\n\n`

src/assistant/llm-selection.ts

Lines changed: 11 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,12 @@ import type * as vscode from "vscode";
22
import { isPositron } from "../extension-api-utils/extensionHost";
33

44
export function checkUsingDesiredModel(model: vscode.LanguageModelChat) {
5-
if (isPositron()) {
6-
if (model.name.match(/claude 3.\d sonnet/i)) {
7-
return true;
8-
}
9-
} else {
10-
// We're in VS Code (are there any other VS Code forks that implement the
11-
// chat APIs?)
12-
if (model.name.match(/claude 3.5 sonnet/i)) {
13-
return true;
14-
}
5+
// In older versions of VS Code, the model names were like "Claude 3.5
6+
// Sonnet", but in newer versions, they are like "Claude Sonnet 3.5".
7+
// In Positron as of this writing, the model names are like "Claude 3.5
8+
// Sonnet".
9+
if (model.name.match(/claude .*sonnet/i)) {
10+
return true;
1511
}
1612

1713
return false;
@@ -37,15 +33,9 @@ export function displayDesiredModelSuggestion(
3733
stream.markdown(
3834
`It looks like you are using **${modelName}** for Copilot. `
3935
);
40-
if (modelName.match(/claude 3.7 sonnet/i)) {
41-
stream.markdown(
42-
"**Claude 3.7 Sonnet** currently doesn't work with chat participants like `@shiny`.\n\n"
43-
);
44-
} else {
45-
stream.markdown(
46-
`For best results with \`@shiny\`, please switch to **${desiredModelName()}**.\n\n`
47-
);
48-
}
36+
stream.markdown(
37+
`For best results with \`@shiny\`, please switch to **${desiredModelName()}**.\n\n`
38+
);
4939
}
5040

5141
stream.button({
@@ -62,8 +52,8 @@ export function displayDesiredModelSuggestion(
6252

6353
export function desiredModelName() {
6454
if (isPositron()) {
65-
return "Claude 3.7 Sonnet";
55+
return "Claude 4 Sonnet";
6656
} else {
67-
return "Claude 3.5 Sonnet";
57+
return "Claude Sonnet 4";
6858
}
6959
}

0 commit comments

Comments
 (0)