Python PyCharm DeepSeek接入
創建API key
首先進入DeepSeek官網,https://www.deepseek.com/
點擊左側“API Keys”,創建API key,輸出名稱為“AI”
點擊“創建",將API key保存,復制在其它地方。
在PyCharm中下載Continue插件
安裝
下載中
下載完成后,點擊OK
配置Continue
安裝完成后,在右側的標簽欄中,會顯示一個Continue的標簽,點擊進入
填寫申請的key
彈出配置文件
我們替換
{"completionOptions": {"BaseCompletionOptions": {"temperature": 0,"maxTokens": 256}},"models": [{"title": "DeepSeek","model": "deepseek-chat","contextLength": 128000,"apiKey": "your apiKey","provider": "deepseek","apiBase": "https://api.deepseek.com/beta"},{"model": "gpt-4o","title": "GPT-4o","systemMessage": "You are an expert software developer. You give helpful and concise responses.","apiKey": "your apiKey","provider": "openai"}],"tabAutocompleteModel": {"title": "DeepSeek Coder","model": "deepseek-coder","apiKey": "your apiKey","provider": "deepseek","apiBase": "https://api.deepseek.com/beta"},"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": "diff","params": {}},{"name": "folder","params": {}},{"name": "codebase","params": {}}],"slashCommands": [{"name": "share","description": "Export the current chat session to markdown"},{"name": "commit","description": "Generate a git commit message"}]
}
這三處換成你的key