diff --git a/src/api/providers/anthropic.ts b/src/api/providers/anthropic.ts index 959916e9a8..1b087bcda7 100644 --- a/src/api/providers/anthropic.ts +++ b/src/api/providers/anthropic.ts @@ -20,7 +20,7 @@ export class AnthropicHandler implements ApiHandler { @withRetry() async *createMessage(systemPrompt: string, messages: Anthropic.Messages.MessageParam[]): ApiStream { const model = this.getModel() - let stream: AnthropicStream + let stream: AnthropicStream const modelId = model.id switch (modelId) { // 'latest' alias does not support cache_control @@ -38,7 +38,7 @@ export class AnthropicHandler implements ApiHandler { ) const lastUserMsgIndex = userMsgIndices[userMsgIndices.length - 1] ?? -1 const secondLastMsgUserIndex = userMsgIndices[userMsgIndices.length - 2] ?? -1 - stream = await this.client.beta.promptCaching.messages.create( + stream = await this.client.messages.create( { model: modelId, max_tokens: model.info.maxTokens || 8192,