前言¶
DeepSeek Harness (DSH) 採用“一切皆插件”的架構,允許開發者通過插件擴展模型推理能力。xby-pet-detect 是一個專注於模型推理的插件,由 xby-skill 維護。它主要用於解決寵物面部表情識別的需求,將圖片輸入轉換爲結構化的情緒分類數據。
安裝¶
通過 DSH 的插件管理工具安裝,支持從 GitHub 倉庫安裝或本地調試。
從 GitHub 安裝¶
使用官方安裝命令添加插件:
dsh plugin --profile web add github:xby_skill/xby-pet-detect
本地開發調試¶
若需進行本地開發,可使用絕對路徑安裝或通過 patch 文件調試:
dsh plugin --profile web add /absolute/path/to/xby-pet-detect
dsh web --profile web --patch /absolute/path/to/dsh-ocr-plugin/cordis.patch.yml
核心功能¶
該插件提供三個主要的推理接口,支持不同的圖片輸入格式。
-
set_xby_apikey
在聊天中設置 API 密鑰。該操作會自動持久化,重啓 DSH 進程後依然有效。 -
pet_emotion_recognition
識別寵物面部表情,輸出 4 類情緒:Angry / Happy / Relaxed / Sad。
- 輸入要求:需要輸入圖片文件鏈接。 -
pet_emotion_recognition_for_data_base64
識別寵物面部表情,輸出 4 類情緒:Angry / Happy / Relaxed / Sad。
- 輸入要求:需要輸入圖片文件的 BASE64 編碼。 -
pet_emotion_recognition_for_data_file
識別寵物面部表情,輸出 4 類情緒:Angry / Happy / Relaxed / Sad。
- 輸入要求:需要輸入圖片文件的文件路徑。
前置條件與配置¶
插件依賴外部 API 服務,使用前需完成以下配置。
獲取 API 密鑰¶
插件需要前往小笨羊官網註冊並獲取 API 密鑰。
- 官網地址:https://xiaobenyang.com
使用步驟¶
- 在 DSH 聊天環境中調用
set_xby_apikey命令設置密鑰。 - 根據圖片來源,選擇對應的識別接口:
- 若圖片爲鏈接,使用pet_emotion_recognition。
- 若圖片爲 Base64 字符串,使用pet_emotion_recognition_for_data_base64。
- 若圖片爲本地文件,使用pet_emotion_recognition_for_data_file。
生態背景¶
DSH 插件目錄(https://www.skillhub.cn/plugins/xby-skill/xby-pet-detect)與 DeepSeek 或幻方研究院無官方從屬關係。該插件遵循 MIT 許可證,開發者可自由使用與修改。