
社群是國內外知名的機器學習與自然語言處理社群,受眾覆蓋國內外NLP碩博生、高校老師以及企業研究人員。
DeepSeek 是一家專注於人工智慧技術研發的公司,致力於開發高效能、低成本的 AI 模型。DeepSeek-V3 是 DeepSeek 公司推出的最新一代 AI 模型。其前身是 DeepSeek-V2.5,經過持續的最佳化和升級,V3 版本在效能、速度和成本方面都取得了顯著提升。DeepSeek-V3 的釋出表明,國產 AI 模型在技術層面已經具備與國際頂尖模型(例如 GPT-4o)競爭的實力。
接下來,我們把DeepSeek接入到PyCharm中,並利用其能力輔助我們進行程式碼開發。
效果演示
首先來看一下效果。
我們可以直接選中程式碼,並對程式碼段進行解釋

我們也可以透過選中程式碼,對程式碼進行修改


建立API key
首先進入DeepSeek官網,官網連結如下
https://www.deepseek.com/
點選API開放平臺:


點選左側“API Keys”,點選建立API key,輸出名稱為“AI程式碼提示”,也可以使用其它自定義的名稱

點選“建立",一定要記錄此處的API key,可以先將API key複製在其它地方。

在PyCharm中下載Continue外掛
開啟PyCharm,開啟檔案->設定->外掛,搜尋“Continue”,點選安裝。

等待外掛安裝完畢後,點選“應用”,外掛安裝成功。
配置Continue
外掛安裝成功後,在右側的標籤欄中,會顯示一個Continue的標籤,我們點選即可進入,隨後點選設定按鍵,如下圖。

點選後,文字編輯區將會彈出配置檔案。

我們對配置檔案進行修改,將內容替換為下面的內容:
{
"completionOptions": {
"BaseCompletionOptions": {
"temperature": 0.0,
"maxTokens": 256
}
},
"models": [
{
"title": "DeepSeek",
"model": "deepseek-chat",
"contextLength": 128000,
"apiKey": "REDACTED",
"provider": "deepseek",
"apiBase": "https://api.deepseek.com/beta"
}
],
"tabAutocompleteModel": {
"title": "DeepSeek Coder",
"model": "deepseek-coder",
"apiKey": "REDACTED",
"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"
}
]
}
修改時將會彈出提示,點選確定。

隨後,我們將兩處apiKey替換為先前儲存的API key。


儲存檔案後,即可開始使用。


掃描二維碼新增小助手微信
關於我們
