Skip to main content

在 Copilot 对话助手中使用 Claude

了解如何在 GitHub Copilot Chat 中为你自己或你的组织启用 Claude。

关于 GitHub Copilot Chat

中的 Claude

注意

Copilot Chat 中的 Claude Opus 4 和 Claude Sonnet 4 目前为 公共预览版,可能会变动。

Claude 是一系列大型语言模型,可以作为 Copilot Chat 使用的默认模型的替代模型。 Claude 在整个软件开发生命周期(从初始设计到 bug 修复、维护和优化)中的任务编码方面表现出色。 详细了解 Claude 的功能

  • Claude Opus 4 在以下位置提供:

    • Visual Studio Code 中的 Copilot Chat
    • GitHub 中 Copilot Chat 中的沉浸式模式
  • Claude Sonnet 4 在以下位置提供:

    • Visual Studio Code 中的 Copilot Chat
    • GitHub 中 Copilot Chat 中的沉浸式模式
  • Claude 3.5 Sonnet 和 Claude 3.7 Sonnet 在以下资产中可用:

    • Visual Studio Code 中的 Copilot Chat
    • Visual Studio 2022 中的 Copilot Chat
      • 3.5****:版本 17.12 或更高版本
      • 3.7****:版本 17.13 或更高版本
    • Xcode 中的 Copilot Chat
    • Eclipse 中的 Copilot Chat
    • JetBrains 中的 Copilot Chat
    • GitHub 中 Copilot Chat 中的沉浸式模式

Claude Opus 4 和 Claude Sonnet 4 由 Anthropic PBC 和 Google Cloud Platform 托管。 Claude 3.7 Sonnet 由 Amazon Web Services、Anthropic PBC 和 Google Cloud Platform 托管。 Claude 3.5 Sonnet 由 Amazon Web Services 专门托管。 GitHub 已与提供商签署协议,确保数据不会被用于训练。 下面列出了每个提供商的其他详细信息:

为了提升服务质量并降低延迟,GitHub 使用了 提示缓存技术。 可以阅读有关 Anthropic PBCAmazon BedrockGoogle Cloud 上的提示缓存的详细信息。

使用 Claude 时,输入提示和输出补全将继续通过 GitHub Copilot 的内容筛选器运行,这些筛选器会进行公共代码匹配(如果应用),同时筛选有害、冒犯性或偏离主题的内容。

配置访问权限

必须先单独启用对每个 Claude 的访问,然后才能使用该模型。

设置供个人使用

注意

  • Claude Opus 4 当前不适用于 Copilot 免费版 和 Copilot 专业版。
  • Claude Sonnet 4 和 Claude 3.7 Sonnet 当前不适用于 Copilot 免费版。
  • Claude 3.7 Sonnet 当前不适用于 Copilot 免费版。

如果有 Copilot 免费版 或 Copilot 专业版 订阅,可以通过两种方式启用 Claude:

  • 首次选择在 Visual Studio Code 或 Copilot Chat 的沉浸式视图中将 Claude 模型与 Copilot Chat 一起使用时,系统会提示你允许访问该模型。

    单击“Allow”后,可以使用 Claude 并在 GitHub 上的个人设置中更新策略****。

  • 可以直接在 GitHub 网站上的个人设置中启用模型。 请参阅“以单个订阅者身份管理 Copilot 策略”。

针对组织使用的设置

注意

Claude Opus 4 当前不适用于 Copilot Business。

作为或组织所有者,你可以为已通过你的组织获得 Copilot Business 席位的每个人启用或禁用 Claude 模型。 请参阅“管理组织中的 Copilot 策略”。

使用 Claude

有关如何更改 Copilot Chat 使用的模型的详细信息,请参阅 正在更改 Copilot Chat 的 AI 模型

留下反馈

若要对 Copilot 中的 Claude 留下反馈或提出问题,请查看 GitHub Community 讨论 Claude 3.5 Sonnet 目前以公共预览版形式向所有 Copilot 用户提供