Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update zh-CN docs #4189

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions docs/i18n/zh-CN/code.json
Original file line number Diff line number Diff line change
Expand Up @@ -436,5 +436,9 @@
"theme.tags.tagsPageTitle": {
"message": "标签",
"description": "The title of the tag list page"
},
"theme.blog.author.noPosts": {
"message": "This author has not written any posts yet.",
"description": "The text for authors with 0 blog post"
}
}
4 changes: 4 additions & 0 deletions docs/i18n/zh-CN/docusaurus-plugin-content-docs/current.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,5 +46,9 @@
"sidebar.customizingSidebar.category.Tutorials": {
"message": "教程",
"description": "The label for category Tutorials in sidebar customizingSidebar"
},
"sidebar.customizingSidebar.link.Reference": {
"message": "参考",
"description": "The label for link Reference in sidebar customizingSidebar, linking to /reference"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ sidebar_position: 4

action 生成行内 diff ,比如 "/edit", "/comment" 或右击 action ,使用与 [编辑](edit/how-it-works.md) 相同的提示词和响应处理逻辑。

要了解其他斜杠命令如何工作的, [在这里](../customize/slash-commands.md) 查看完整参考。
要了解其他斜杠命令如何工作的, [在这里](../customize/slash-commands.mdx) 查看完整参考。
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Continue 有一个大的内置斜杠命令库,但是当你首次安装时,

<!-- TODO: We need a config.ts reference -->
<!-- :::tip[config.ts]
Before adding a custom slash command, we recommend reading the [introduction to `config.ts`](../customize/config.mdx).
Before adding a custom slash command, we recommend reading the [introduction to `config.ts`](../customize/deep-dives/ways-to-configure.md).
::: -->

如果你想比使用自然语言编写定制命令更进一步,你可以编写一个定制函数返回响应。这需要使用 `config.ts` 替代 `config.json` 。
Expand Down Expand Up @@ -58,4 +58,4 @@ export function modifyConfig(config: Config): Config {

目前,其他 action 触发器没有开放配置,但是我们计划在未来通过 .prompt 文件来允许。

<!-- For any actions defined in a .prompt file, you can [configure a specific model](TODO). -->
<!-- For any actions defined in a .prompt file, you can [configure a specific model](/). -->
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ Actions 是常见用例的快捷方式。例如,你可能想要审查代码,

### 斜杠命令

最常见的调用 action 的方法是使用斜杠命令。通过输入 '/' 并在下拉框中选择,这里有快捷方式会被激活。例如,内置的 '/edit' 斜杠命令,让你可以直接在你的编辑器中流式地编辑。
最常见的调用 action 的方法是使用斜杠命令。通过输入 '/' 可以激活快捷方式,在聊天会话中(按下 <kbd>cmd/ctrl</kbd> + <kbd>L</kbd> (VS Code) 或 <kbd>cmd/ctrl</kbd> + <kbd>J</kbd> (JetBrains)),并在下拉框中选择。例如,内置的 '/edit' 斜杠命令,让你可以直接在你的编辑器中流式地编辑。

![slash-commands](/img/slash-commands.png)

一些最常用的斜杠命令默认是可用的,比如 "/edit", "/comment" 和 "/share" ,但是 Continue 有大量内置的其他选择的库。要启用它们,[在这里](../customize/slash-commands.md) 了解更多。
一些最常用的斜杠命令默认是可用的,比如 "/edit", "/comment" 和 "/share" ,但是 Continue 有大量内置的其他选择的库。要启用它们,[在这里](../customize/slash-commands.mdx) 了解更多。

### prompt 文件

Expand Down Expand Up @@ -48,7 +48,7 @@ Write unit tests for the above selected code, following each of these instructio
- Don't explain how to set up `jest`
```

现在要使用这个提示词,你可以高亮代码,并使用 `cmd/ctrl+L` 来选择它到 Continue 侧边栏中。
现在要使用这个提示词,你可以高亮代码,并使用 <kbd>cmd/ctrl</kbd> + <kbd>L</kbd> 来选择它到 Continue 侧边栏中。

然后,输入 "/" 来查看斜杠命令列表,选择名为 "test" 的那个。按下回车, LLM 会响应你的 prompt 文件中给出的指令。

Expand Down Expand Up @@ -76,10 +76,10 @@ Write unit tests for the above selected code, following each of these instructio

#### 调试 action

调试 action 是 VS Code 扩展中一个特殊的内置键盘快捷方式。使用 `cmd/ctrl+shift+R` 来快速复制当前终端的内容到聊天侧边栏,并获得调试建议。
调试 action 是 VS Code 扩展中一个特殊的内置键盘快捷方式。使用 <kbd>cmd/ctrl</kbd> + <kbd>shift</kbd> + <kbd>R</kbd> 来快速复制当前终端的内容到聊天侧边栏,并获得调试建议。

#### 快速修复

无论何时在你的代码中看到红色/黄色下划线表示错误,你可以把光标放到附近, VS Code 会显示一个灯泡图标。无论点击灯泡,或使用 `cmd/ctrl+.` 快捷键,将会显示一个快速修复的下拉菜单。其中之一是 "Ask Continue" action 。无论单击或再次使用 `cmd/ctrl+.` , Continue 将尝试帮助解决问题。
无论何时在你的代码中看到红色/黄色下划线表示错误,你可以把光标放到附近, VS Code 会显示一个灯泡图标。无论点击灯泡,或使用 <kbd>cmd/ctrl</kbd> + <kbd>.</kbd> 快捷键,将会显示一个快速修复的下拉菜单。其中之一是 "Ask Continue" action 。无论单击或再次使用 <kbd>cmd/ctrl</kbd> + <kbd>.</kbd> , Continue 将尝试帮助解决问题。

![ask-continue](/img/ask-continue.png)
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ sidebar_position: 3

### 来自语言服务协议的定义

类似于你如何在编辑器中使用 `cmd/ctrl + click` ,我们使用相同的工具 (LSP) 来增强 "转到定义" 。例如,如果你输入一个函数调用,我们将包含函数定义。或者,如果你在一个方法中写代码,我们将包含类型定义中的任何参数或返回类型。
类似于你如何在编辑器中使用 <kbd>cmd/ctrl</kbd> + `click` ,我们使用相同的工具 (LSP) 来增强 "转到定义" 。例如,如果你输入一个函数调用,我们将包含函数定义。或者,如果你在一个方法中写代码,我们将包含类型定义中的任何参数或返回类型。

### 导入文件

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,6 @@ sidebar_position: 4

如果响应是坏的,我们也会偶尔过滤掉整个响应。这通常是因为过度的重复。

You can learn more about how it works in the [Autocomplete deep dive](../customize/deep-dives/autocomplete.md).
You can learn more about how it works in the [Autocomplete deep dive](../customize/deep-dives/autocomplete.mdx).

你可以在 [深入理解自动补全](../customize/deep-dives/autocomplete.md) 中了解它是如何工作的。
你可以在 [深入理解自动补全](../customize/deep-dives/autocomplete.mdx) 中了解它是如何工作的。
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ Continue 在 [`config.json`](../json-reference.md) 提供少量的参数,对
- `prefixPercentage`: 决定提示词使用光标前代码的比例
- `multilineCompletions`: 控制建议是否可以跨多行 ("always", "never" 或 "auto")

对于所有配置选项和它们的影响的综合指南,查看 [深入理解自动补全](../customize/deep-dives/autocomplete.md) 。
对于所有配置选项和它们的影响的综合指南,查看 [深入理解自动补全](../customize/deep-dives/autocomplete.mdx) 。
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ sidebar_position: 1

### 接受整个建议

按下 `Tab` ,接受整个建议
按下 <kbd>Tab</kbd> ,接受整个建议

### 拒绝整个建议

按下 `Esc` ,拒绝整个建议
按下 <kbd>Esc</kbd> ,拒绝整个建议

### 部分接受建议

对于更细粒度的控制,使用 `cmd/ctrl + →` 来逐字地接受部分建议。
对于更细粒度的控制,使用 <kbd>cmd/ctrl</kbd> + <kbd>→</kbd> 来逐字地接受部分建议。

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
---
title: 模型设置
description: 自动补全 \- 模型设置
keywords: [模型, 自动补全]
sidebar_position: 2
---

:::info
This page recommends models and providers for Autocomplete. Read more about how to set up your `config.json` [here](../reference.md).
:::

## 最好的总体体验

为了最好的自动补全体验,我们推荐通过 [Mistral API](https://console.mistral.ai/) 使用 Codestral 。这个模型提供高质量的补全,使用极好的代码上下文理解:

```json title="config.json"
{
"tabAutocompleteModel": {
"title": "Codestral",
"provider": "mistral",
"model": "codestral-latest",
"apiKey": "YOUR_API_KEY"
}
}
```

:::tip[Codestral API Key]
Codestral 的 API key 和通常的 Mistral API 是不同的。如果你使用 Codestral ,你可能想要一个 Codestral API key ,但是如果你想分享 key 给团队或其他人想要使用 `api.mistral.ai` ,那么确保在你的 `tabAutocompleteModel` 中设置 `"apiBase": "https://api.mistral.ai/v1"` 。
:::

## 本地的,离线的/自托管的体验

对于倾向于本地执行或自托管的, `Qwen2.5-Coder 1.5B` 提供了一个对于大多数用户性能和质量的平衡,(e.g. using [Ollama](../customize/model-providers/top-level/ollama.mdx) or [LM Studio](../customize/model-providers/more/lmstudio.mdx)):

```json title="config.json"
{
"tabAutocompleteModel": {
"title": "Qwen2.5-Coder 1.5B",
"model": "qwen2.5-coder:1.5b-base",
"provider": "ollama"
}
}
```

有更多的计算?使用 `qwen2.5-coder:7b-base` 获取可能更高质量的建议。

:::note
对于 LM Studio 用户,导航到 "My Models" 章节,找到你想要的模型,复制它的路径(例如, `Qwen/Qwen2.5-Coder-1.5B-Instruct-GGUF/qwen2.5-coder-1.5b-instruct-q4_k_m.gguf`)。使用这个路径作为你的配置中的 `model` 值。
:::

### 使用一个远程的实例

当使用一个远程的实例时,你需要在配置中设置 `"apiBase"` 值:

```json title="config.json""
{
"tabAutocompleteModel": {
"title": "Qwen2.5-Coder 1.5B",
"model": "qwen2.5-coder:1.5b-base",
"provider": "ollama"
"apiBase": "http://<my endpoint>:11434"
}
}
```

## 其他体验

有很多更多的模型或提供者可以用来补全。在 [这里](../customize/model-types/autocomplete.md) 查看它们。你也可以在 [这里](../customize/deep-dives/autocomplete.mdx) 看到更多自动补全配置的示例
Original file line number Diff line number Diff line change
Expand Up @@ -11,27 +11,27 @@ sidebar_position: 3

## 高亮代码

你通过按下 `cmd/ctrl + L` (VS Code) 或 `cmd/ctrl + J` (JetBrains) 选择的高亮代码,将包含在你的提示词中,和你提供的输入一起。这是提供给模型的仅有的代码片段,除非你高亮更多的片段,或使用以下的选择方法之一。
你通过按下 <kbd>cmd/ctrl</kbd> + <kbd>L</kbd> (VS Code) 或 <kbd>cmd/ctrl</kbd> + <kbd>J</kbd> (JetBrains) 选择的高亮代码,将包含在你的提示词中,和你提供的输入一起。这是提供给模型的仅有的代码片段,除非你高亮更多的片段,或使用以下的选择方法之一。

## 活动文件

在发送请求时,你可以通过按下 `cmd/ctrl + opt + enter` 包含当前打开的文件作为上下文。
在聊天窗口发送请求时(提示词不能为空),你可以通过按下 <kbd>opt</kbd> + <kbd>enter</kbd> (Mac) 或 <kbd>alt</kbd> + <kbd>enter</kbd> (Windows) 包含当前打开的文件作为上下文。

## 指定文件

你可以通过输入 [`@Files`](../customize/context-providers.mdx#file) 并选择文件,包含当前工作区中的指定文件作为上下文。

## 指定目录

你可以通过输入 [`@Folder`](../customize/context-providers.mdx#folder) 并选择目录,包含当前工作区中指定目录作为上下文。它像 [`@Codebase`](../customize/deep-dives/codebase.md) 一样工作,但是只包含指定目录中的文件。
你可以通过输入 [`@Folder`](../customize/context-providers.mdx#folder) 并选择目录,包含当前工作区中指定目录作为上下文。它像 [`@Codebase`](../customize/deep-dives/codebase.mdx) 一样工作,但是只包含指定目录中的文件。

## 整个代码库
## 代码库搜索

你可以通过输入 [`@Codebase`](../customize/context-providers.mdx#codebase) 包含整个代码库作为上下文。你可以 [在这里](../customize/deep-dives/codebase.md) 了解 `@Codebase` 是如何工作的。
你可以通过输入 [`@Codebase`](../customize/context-providers.mdx#codebase) 自动包含与你的代码库相关的文件作为上下文。你可以 [在这里](../customize/deep-dives/codebase.mdx) 了解 `@Codebase` 是如何工作的。

## 文档网址

你可以通过输入 [`@Docs`](../customize/context-providers.mdx#docs) 并选择文档网址,包含文档网址作文上下文。你可以 [在这里](../customize/deep-dives/docs.md) 了解 `@Docs` 是如何工作的。
你可以通过输入 [`@Docs`](../customize/context-providers.mdx#docs) 并选择文档网址,包含文档网址作文上下文。你可以 [在这里](../customize/deep-dives/docs.mdx) 了解 `@Docs` 是如何工作的。

## 终端内容

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,8 @@ sidebar_position: 4

使用任何选择的代码片段,你使用 @ 选择的所有上下文,以及你的输入指令,在侧边栏中,我们将提示词给模型,让它提供一个响应。如果你询问跟进的问题,那么所有前面的会话上下文也会被包含。没有其他更多的上下文提供给模型。

模型的响应会直接流式地返回到侧边栏。每个响应中的代码片段将放在它自己的代码块中,每个代码块会给你一些按钮,“应用到当前文件”, “插入到光标处” 或 “复制” 。当你在会话的结尾按下 `cmd/ctrl + L` (VS Code) 或 `cmd/ctrl + J` (JetBrains) ,所有上下文会被清除,一个新的会话将会开始,让你可以开始一个新的任务。
模型的响应会直接流式地返回到侧边栏。每个响应中的代码片段将放在它自己的代码块中,每个代码块会给你一些按钮,“应用到当前文件”, “插入到光标处” 或 “复制” 。当你在会话的结尾按下 <kbd>cmd/ctrl</kbd> + <kbd>L</kbd> (VS Code) 或 <kbd>cmd/ctrl</kbd> + <kbd>J</kbd> (JetBrains) ,所有上下文会被清除,一个新的会话将会开始,让你可以开始一个新的任务。

如果你想查看聊天中发送给模型的确切的提示词,你可以 [在提示词日志中查看这个](../troubleshooting.md#llm-提示词日志) 。
如果你想查看聊天中发送给模型的确切的提示词,你可以 [在提示词日志中查看这个](troubleshooting.mdx#llm-提示词日志) 。

You can learn more about how `@Codebase` works [here](../customize/deep-dives/codebase.md) and `@Docs` [here](../customize/deep-dives/docs.md).

你可以 [在这里](../customize/deep-dives/codebase.md) 了解 `@Codebase` 是如何工作的, 以及 [在这里](../customize/deep-dives/docs.md) 了解 `@Docs` 。
你可以 [在这里](../customize/deep-dives/codebase.mdx) 了解 `@Codebase` 是如何工作的, 以及 [在这里](../customize/deep-dives/docs.mdx) 了解 `@Docs` 。
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ sidebar_position: 5

这里有多种不同的方法来定制聊天

- 你可以配置 [`@Codebase`](../customize/deep-dives/codebase.md)
- 你可以创建自己的 [定制代码 RAG](../customize/tutorials/custom-code-rag.md)
- 你可以配置 [`@Docs`](../customize/deep-dives/docs.md)
- 你可以添加一个 [`.continuerules`](../customize/deep-dives/rules.md) 文件到你的项目根目录来配置系统提示词
- 你可以配置 [`@Codebase`](../customize/deep-dives/codebase.mdx)
- 你可以创建自己的 [定制代码 RAG](../customize/tutorials/custom-code-rag.mdx)
- 你可以配置 [`@Docs`](../customize/deep-dives/docs.mdx)
- 你可以 [构建自己的上下文提供者](../customize/tutorials/build-your-own-context-provider.md)
- 你可以配置和创建定制的 [工具](../customize/tools.mdx)
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ sidebar_position: 1

## 高亮代码片段作为上下文

你使用鼠标选择代码片段,按下 `cmd/ctrl + L` (VS Code) 或 `cmd/ctrl + J` (JetBrains) 将它发送给 LLM ,然后让它给你解释,或者请求它以某种方式优化。
你使用鼠标选择代码片段,按下 <kbd>cmd/ctrl</kbd> + <kbd>L</kbd> (VS Code) 或 <kbd>cmd/ctrl</kbd> + <kbd>J</kbd> (JetBrains) 将它发送给 LLM ,然后让它给你解释,或者请求它以某种方式优化。

## 使用 @ 符号标记上下文

Expand All @@ -32,8 +32,8 @@ sidebar_position: 1

## 对于新的任务开始一个新的会话

一旦你完成任务,想要开始一个新的,按下 `cmd/ctrl + L` (VS Code) 或 `cmd/ctrl + J` (JetBrains) 来开始一个新的会话,确保只有下一个任务相关的上下文提供给 LLM 。
一旦你完成任务,想要开始一个新的,按下 <kbd>cmd/ctrl</kbd> + <kbd>L</kbd> (VS Code) 或 <kbd>cmd/ctrl</kbd> + <kbd>J</kbd> (JetBrains) 来开始一个新的会话,确保只有下一个任务相关的上下文提供给 LLM 。

## 在不同的模型中切换

如果你配置了多个模型,你可以使用下拉框或按下 `cmd/ctrl + ’`在不同的模型中切换。
如果你配置了多个模型,你可以使用下拉框或按下 <kbd>cmd/ctrl</kbd> + <kbd>’</kbd>在不同的模型中切换。
Loading
Loading