Merge pull request #4364 from continuedev/nate/anthropic-key

Give message to user instead of sending request if Anthropic API key not set
This commit is contained in:
Nate Sesti 2025-02-25 23:41:29 -08:00 • committed by GitHub
commit 4c7788174e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 7 additions and 1 deletions

View file

@ -145,6 +145,12 @@ class Anthropic extends BaseLLM {
signal: AbortSignal,
options: CompletionOptions,
): AsyncGenerator<ChatMessage> {
if (!this.apiKey || this.apiKey === "") {
throw new Error(
"Request not sent. You have an Anthropic model configured in your config.json, but the API key is not set.",
);
}
const shouldCacheSystemMessage =
!!this.systemMessage && this.cacheBehavior?.cacheSystemMessage;
const systemMessage: string = stripImages(

View file

@ -2,7 +2,7 @@
"name": "continue",
"icon": "media/icon.png",
"author": "Continue Dev, Inc",
"version": "0.9.271",
"version": "0.9.272",
"repository": {
"type": "git",
"url": "https://github.com/continuedev/continue"