Continue 开源人工智能代码助手使用

发布时间: 更新时间: 总字数:506 阅读时间:2m 作者: IP上海 分享 网址

Continue 是 VS Code 和 JetBrains 内领先的开源人工智能代码助手。

介绍

Continue 支持的功能:

  • 聊天:功能让您无需离开集成开发环境即可轻松向法律硕士寻求帮助
  • 自动补全:功能可在您键入代码时提供内联代码建议 Autocomplete model
  • 编辑:是一种无需离开当前文件即可修改代码的便捷方式
  • 操作:是常用情况下的快捷方式

安装

配置

  • Provider: 支持 Ollama、openAI 等
  • config.json 配置()
{
  "models": [
    {
      "model": "qwen2.5-coder:32b", // 32b的用来提问的时候用
      "title": "qwen2.5-coder:32b",
      "provider": "ollama",
      "systemMessage": "You are an expert software developer. You give helpful and concise responses."
    },
    {
      "title": "DeepSeek Chat",
      "provider": "deepseek",
      "model": "deepseek-chat",
      "apiBase": "",
      "apiKey": "[API_KEY]"
    }
  ],
  "tabAutocompleteModel": { // 如果您想获得最佳的自动完成体验,我们建议您使用 Codestral
    "title": "qwen",
    "provider": "qwen",
    "model": "qwen2.5-coder:1.5b-base",
    "apiBase": "",
    "apiKey": "[API_KEY]"
  },
    "customCommands": [
        {
            "name": "test",
            "prompt": "{{{ input }}}\n\nWrite a comprehensive set of unit tests for the selected code. It should setup, run tests that check for correctness including important edge cases, and teardown. Ensure that the tests are complete and sophisticated. Give the tests just as chat output, don't edit any file.",
            "description": "Write unit tests for highlighted code"
        }
    ],
    "contextProviders": [
        {
            "name": "codebase",
            "params": {
                "nRetrieve": 25,
                "nFinal": 5,
                "useReranking": true
            }
        }
    ],
    "embeddingsProvider": {
        "provider": "openai",
        // text-embedding-ada-002 < text-embedding-3-small < text-embedding-3-large
        "model": "text-embedding-ada-002",
        "apiKey": "your-api",
        "apiBase": "https://www.gptapi.us/v1"
    },
    "reranker": {
        "name": "llm",
        "params": {
            "modelTitle": "GPT-4o"
        }
    },
    "allowAnonymousTelemetry": false
}

使用

参考

  1. https://docs.continue.dev/
  2. https://github.com/continuedev/continue
Home Archives Categories Tags Statistics
本文总阅读量 次 本站总访问量 次 本站总访客数