Note
目前仅支持 GitHub Copilot Chat in GitHub 的个人自定义说明。
有关可用于自定义 GitHub Copilot Chat 回复的方法的概述,请参阅“About customizing GitHub Copilot Chat responses”。
关于 GitHub Copilot Chat 的个人自定义说明
你可以为 GitHub Copilot Chat 添加自定义指令,从而在 GitHub 网��上的对话中获得符合你个人偏好的聊天响应。 例如,可以选择始终让 Copilot Chat 使用首选语言或特定风格响应。 以下是可以添加的说明的一些示例:
Always respond in Spanish.
Your style is a helpful colleague, minimize explanations but provide enough context to understand the code.
Always provide examples in TypeScript.
Note
- It is possible for multiple types of custom instructions to apply to a conversation. Personal instructions take the highest priority, followed by repository instructions, with organization instructions prioritized last. However, all sets of relevant instructions are still combined and provided to Copilot Chat.
- Whenever possible, you should avoid providing conflicting sets of instructions. If you are concerned about response quality, you can also choose to temporarily disable repository instructions. See 为 GitHub Copilot 添加存储库自定义说明.
添加个人自定义说明
可以在聊天面板或沉浸式模式下添加个人自定义指令。 这两种模式将应用相同的指令。
-
在 GitHub 上的任何页面的右上角,可以执行以下操作之一:
- 单击 图标以打开 Copilot Chat 面板****。
- 单击 图标旁边的 ,然后单击“Immersive”以在整页的沉浸式模式下打开 Copilot Chat。******** 还可直接前往 https://github.com/copilot。
-
选择聊天面板或沉浸式页面右上角的 下拉菜单,然后单击“Personal instructions”****。
-
向文本框添加自然语言说明。
可以采用任何你偏好的格式来编写指令。 例如,可以将指令写成一整段文本,也可以每条指令另起一行,或者用空行将它们分隔开来。
-
你还可以单击 ,查看可用于常见指令的模板。 如果你单击某个框,例如“Communication”,相应的指令将添加到文本框中,并带有占位符(如
{format}
),你可以将其替换为你的偏好设置。 -
单击“ 保存”。 说明现已生效并将一直保持有效,直至被更改��删除。
若要查看指令的实际效果,请转到 https://github.com/copilot 并开始对话。