|
| 1 | +--- |
| 2 | +title: 快速入门 |
| 3 | +description: 几分钟内开始使用 AutoDev |
| 4 | +--- |
| 5 | + |
| 6 | +import Tabs from '@theme/Tabs'; |
| 7 | +import TabItem from '@theme/TabItem'; |
| 8 | + |
| 9 | +# 安装与设置 |
| 10 | + |
| 11 | +<Tabs> |
| 12 | + <TabItem value="marketplace" label="JetBrains 插件市场" default> |
| 13 | + 直接从 JetBrains 插件市场安装:[AutoDev Sketch](https://plugins.jetbrains.com/plugin/26988-autodev-sketch) |
| 14 | + |
| 15 | + **注意:** 该插件在 JetBrains 插件市场中名为 `AutoDev Sketch`,ID 为 `com.unitmesh.autodev`。与自定义仓库和 GitHub 发布版本不同。 |
| 16 | + |
| 17 | + 此版本适用于 IDE 2024.1 及更新版本 (241+)。 |
| 18 | + </TabItem> |
| 19 | + <TabItem value="repository" label="自定义仓库"> |
| 20 | + 1. 前往 `设置` → `插件` → `插件市场` → `管理插件仓库` |
| 21 | + 2. 添加以下 URL: |
| 22 | + ``` |
| 23 | + https://plugin.unitmesh.cc/updatePlugins.xml |
| 24 | + ``` |
| 25 | + </TabItem> |
| 26 | + <TabItem value="github" label="GitHub 发布版本"> |
| 27 | + 1. 从 [GitHub Releases](https://github.com/unit-mesh/auto-dev/releases) 下载适合的版本 |
| 28 | + - AutoDev-*-222.zip — 适用于 2022.2 到 2023.2 版本 |
| 29 | + - AutoDev-*-233.zip — 适用于 2023.3 版本 |
| 30 | + - AutoDev-*-241.zip — 适用于 2024.1 及更新版本 |
| 31 | + 2. 在 JetBrains IDE 中从磁盘安装插件 |
| 32 | + </TabItem> |
| 33 | +</Tabs> |
| 34 | + |
| 35 | +## 配置 |
| 36 | + |
| 37 | +安装后,在 `设置` → `工具` → `AutoDev` 中配置插件 |
| 38 | + |
| 39 | +### 默认 LLM |
| 40 | + |
| 41 | +支持的提供商:Deepseek ([#96](https://github.com/unit-mesh/auto-dev/issues/96)),Moonshot AI,ChatGLM([#90](https://github.com/unit-mesh/auto-dev/issues/960)) |
| 42 | + |
| 43 | +<Tabs> |
| 44 | + <TabItem value="basic" label="基础配置" default> |
| 45 | + 1. 在 `设置` → `工具` → `AutoDev` 中打开 AutoDev 配置 |
| 46 | + 2. 配置 `LLM 服务器地址`,例如: |
| 47 | + - Deepseek: `https://api.deepseek.com/chat/completions` |
| 48 | + - OpenAI: `https://api.openai.com/v1/chat/completions` |
| 49 | + 3. 输入您的 `LLM 密钥`(API 密钥) |
| 50 | + 4. 使用 [JsonPath](https://github.com/json-path/JsonPath) 设置 `自定义响应格式`,例如: |
| 51 | + - `$.choices[0].delta.content` |
| 52 | + 5. 配置 `自定义请求格式`,例如: |
| 53 | + - `{ "customFields": {"model": "deepseek-chat", "stream": true }}` |
| 54 | + </TabItem> |
| 55 | + <TabItem value="advanced" label="高级配置"> |
| 56 | + 有关更详细的配置选项,请参见 [自定义 LLM 服务器](/custom/llm-server) |
| 57 | + </TabItem> |
| 58 | +</Tabs> |
| 59 | + |
| 60 | +### 附加模型 |
| 61 | + |
| 62 | +可用的模型类型: |
| 63 | +- `Plan`:用于推理和规划(推荐:DeepSeek R1) |
| 64 | +- `Completion`:用于代码补全 |
| 65 | +- `FastApply`:用于修复补丁生成(例如,`Kortix/FastApply-1.5B-v1.0`) |
| 66 | +- `Others`:通用占位符 |
| 67 | +- ~~Act~~:(尚未就绪)用于执行操作(例如,`DeepSeek V3`,`Qwen 72B`) |
| 68 | +- ~~Embedding~~:(尚未就绪)用于嵌入函数(例如,`sentence-transformers/all-MiniLM-L6-v2`) |
| 69 | + |
| 70 | +<Tabs> |
| 71 | + <TabItem value="deepseek" label="DeepSeek R1" default> |
| 72 | + ```json |
| 73 | + { |
| 74 | + "name": "DeepSeek R1", |
| 75 | + "url": "https://api.deepseek.com/chat/completions", |
| 76 | + "auth": { |
| 77 | + "type": "Bearer", |
| 78 | + "token": "sk-ii" |
| 79 | + }, |
| 80 | + "requestFormat": "{ \"customFields\": {\"model\": \"deepseek-reasoner\", \"stream\": true}}", |
| 81 | + "responseFormat": "$.choices[0].delta.content", |
| 82 | + "modelType": "Plan" |
| 83 | + } |
| 84 | + ``` |
| 85 | + </TabItem> |
| 86 | + <TabItem value="glm" label="GLM4-Plus"> |
| 87 | + ```json |
| 88 | + { |
| 89 | + "name": "GLM4-Plus", |
| 90 | + "url": "https://open.bigmodel.cn/api/paas/v4/chat/completions", |
| 91 | + "auth": { |
| 92 | + "type": "Bearer", |
| 93 | + "token": "sk-ii" |
| 94 | + }, |
| 95 | + "requestFormat": "{ \"customFields\": {\"model\": \"glm-4-plus\", \"stream\": true}}", |
| 96 | + "responseFormat": "$.choices[0].delta.content", |
| 97 | + "modelType": "FastApply" |
| 98 | + } |
| 99 | + ``` |
| 100 | + </TabItem> |
| 101 | + <TabItem value="dify" label="DifyAI"> |
| 102 | + ```json |
| 103 | + { |
| 104 | + "name": "DifyAI", |
| 105 | + "description": "Dify Example", |
| 106 | + "url": "https://api.dify.ai/v1/completion-messages", |
| 107 | + "auth": { |
| 108 | + "type": "Bearer", |
| 109 | + "token": "app-abcd" |
| 110 | + }, |
| 111 | + "requestFormat": "{\"fields\": {\"inputs\": {\"feature\": \"$content\"}, \"response_mode\": \"streaming\", \"user\": \"phodal\" }}", |
| 112 | + "responseFormat": "$.answer", |
| 113 | + "modelType": "Others" |
| 114 | + } |
| 115 | + ``` |
| 116 | + </TabItem> |
| 117 | +</Tabs> |
| 118 | + |
| 119 | +配置字段: |
| 120 | +- **URL**:包含端点路径的 LLM 服务器地址 |
| 121 | +- **Auth**:认证信息(目前仅支持 Bearer 令牌) |
| 122 | +- **RequestFormat**:API 请求的 JSON 结构 |
| 123 | +- **ResponseFormat**:用于从响应中提取内容的 JsonPath |
| 124 | +- **ModelType**:模型类型(见上面列表) |
| 125 | + |
0 commit comments