前言¶
DeepSeek Harness(DSH)以插件方式擴展 Web 客戶端。dsh-client-ui-girlfriend 是 dalintian 維護的 DSH 插件,許可證爲 MIT。它把 DSH 的 Web 界面改造成微信風格的好友列表和聊天窗口,同時保留原生界面可用。
這是什麼¶
這是一個可管理多個角色、可生成肖像、可結合上下文回覆的聊天插件。插件的 npm 包名是 dsh-client-ui-girlfriend,倉庫地址是 https://github.com/dalintian/Digital-Sweet-Heart。
它主要提供這些能力:
- 微信風格的好友列表與聊天窗口
- 添加、編輯、刪除多個角色
- 根據文字設定生成、重新生成並保存 AI 肖像
- 將完整角色設定注入對話提示詞
- 按聊天上下文生成照片或短視頻
- 上傳照片後由視覺模型分析,並結合上下文回應
- 配置對話、視覺、文生圖、文生視頻四組 OpenAI 兼容 API
- 自動生成
web與girlfriend兩套 DSH 配置並可切換
安裝與啓用¶
運行環境要求:
Node.js >= 22
pnpm
自備 OpenAI 兼容模型接口
如果還沒有 DSH,先按以下步驟獲取並構建 DSH:
git clone https://github.com/deepseek-ai/deepseek-harness.git
cd deepseek-harness
pnpm install
pnpm run build
構建完成後,安裝本插件:
pnpm dsh plugin --profile web add github:dalintian/Digital-Sweet-Heart
安裝完成後,會生成 web 和 girlfriend 兩套 DSH 配置。插件默認以禁用狀態加入 web 配置,因此 pnpm dsh web 仍然啓動原生界面。女友界面使用單獨的配置啓動:
pnpm dsh web
pnpm dsh --profile girlfriend
其中女友界面默認端口是 3081。
如果安裝過程中 postinstall 沒有執行,可以手動補跑一次:
node node_modules/dsh-client-ui-girlfriend/scripts/postinstall.cjs
不使用 dsh plugin 命令時,也可以手動安裝:
cd ~/.dsh/profiles/web
pnpm add github:dalintian/Digital-Sweet-Heart
node node_modules/dsh-client-ui-girlfriend/scripts/postinstall.cjs
升級和卸載命令如下:
pnpm dsh plugin --profile web update github:dalintian/Digital-Sweet-Heart
pnpm dsh plugin --profile web remove dsh-client-ui-girlfriend
首次配置¶
進入女友界面後,在好友列表左下角的配置入口裏配置四組模型 API:
- 對話模型
- 視覺模型
- 文生圖模型
- 文生視頻模型
這四組接口都要求 OpenAI 兼容。API Key 只保存在瀏覽器 localStorage 中,並且只發送給自己配置的接口地址。
典型用法¶
1、添加角色。
在好友列表中新增一個角色,填寫名字、外形、性格、愛好、對話語氣、角色背景等內容。
2、生成肖像。
根據文字設定生成肖像,不滿意可以重新生成,確認滿意後保存。角色設定與肖像圖保存在本機:
<DSH 主目錄>/storages/girlfriend/
角色設定是 Markdown 文件,明文可讀。
3、進行對話。
每次對話時,插件會將完整角色設定注入模型提示詞,使回覆風格與設定保持一致。
4、生成照片或短視頻。
根據當前聊天上下文,可以生成一張照片或一段短視頻。
5、上傳照片。
上傳一張照片後,視覺模型會先分析圖片內容,再結合聊天上下文給出回應。
6、管理角色。
可以編輯已有角色設定,也可以刪除角色。
適用場景與注意¶
這個插件適合在本機單人場景下使用,尤其是已經在使用 DSH,並希望把 Web 界面擴展成角色化聊天界面的用戶。
需要注意幾點:
- 插件會在本機 DSH 進程環境中運行,安裝前應檢查源碼和 MIT 許可證。
/girlfriend/*路由不設鑑權,面向本機單人使用。- 目前只在 Windows 上實機驗證,macOS 和 Linux 未經真機測試。
- 使用效果依賴自備的 OpenAI 兼容模型接口。
- 角色設定和肖像圖保存在本機,文件可直接查看和修改。
鏈接¶
GitHub 倉庫:
https://github.com/dalintian/Digital-Sweet-Heart
如果從 DSH 插件目錄安裝,請以目錄頁面展示的倉庫、版本和許可證信息爲準。本介紹採用上述倉庫地址作爲安裝來源。