如何使用 Continue 配置 Anthropic Claude 模型

在此处了解 Anthropic 模型 here
Anthropic 控制台获取 API 密钥

配置

name: My Config
version: 0.0.1
schema: v1

models:
  - name: <MODEL_NAME>
    provider: anthropic
    model: <MODEL_ID>
    apiKey: <YOUR_ANTHROPIC_API_KEY>
在此处查看更高级的配置 here

如何为 Claude 启用提示词缓存 (Prompt Caching)

Anthropic 支持 Claude 提示词缓存,这允许 Claude 模型在请求之间缓存系统消息和对话历史,从而提高性能并降低成本。
要启用系统消息和对话轮次的缓存,请按照以下方式更新您的模型配置
name: My Config
version: 0.0.1
schema: v1

models:
  - name: <MODEL_NAME>
    provider: anthropic
    model: <MODEL_ID>
    apiKey: <YOUR_ANTHROPIC_API_KEY>
    roles:
      - chat
    defaultCompletionOptions:
      promptCaching: true