dsh-tool-eyes:爲 DeepSeek Harness 增加本地視覺工具

前言

在 DeepSeek Harness(DSH)中,如果希望 agent 能讀取屏幕內容或描述圖片,可以把視覺能力作爲工具掛入現有會話。下面介紹的 dsh-tool-eyes 就是這類本地視覺“眼睛”插件。

它提供兩個工具:screen 用於視覺描述,ocr 用於文字提取。

這是什麼

dsh-tool-eyes 是 go-farther-and-farther 維護的 DSH 插件,許可證爲 MIT。

它解決的核心問題是:在 Windows 環境下,讓 DSH agent 能調用本地視覺端點描述屏幕或圖片,或調用 Windows 內置 OCR 引擎逐字提取文本。

核心功能

screen

screen 捕獲屏幕或描述已有圖片文件,經本地 OpenAI-compatible 視覺端點返回文字描述。

它接受可選 image 路徑;不提供時捕獲屏幕。

screen 的提示詞要求視覺模型只描述可見內容,降低小模型名稱幻覺。

本地優先方面,screen 可指向本地端點,使圖片不出本機。

ocr

ocr 使用 Windows 內置 OCR 引擎逐字提取文本,零模型、零 GPU、零雲端。

它也接受可選 image 路徑;不提供時捕獲屏幕。

ocr 完全本地,無網絡。

安裝與啓用

先確認環境要求:

  • Windows 10/11
  • Node.js >= 22.19
  • DeepSeek Harness >= 0.1.0-rc.6
  • screen 需要任一 OpenAI-compatible VLM endpoint,例如 llama.cpp、LM Studio、Ollama 或任意網關

該包僅發佈在 GitHub,不在 npm。安裝命令如下:

dsh plugin --profile web add https://github.com/go-farther-and-farther/dsh-tool-eyes

安裝後重啓 dsh web,screen 和 ocr 工具會自動出現在 agent toolkit。

配置

如果需要指定 screen 使用的視覺端點,可以在 profile 的 cordis.patch.yml 中按 id tool-eyes 配置 baseUrl、model、timeoutMs。

結構示例如下:

- id: tool-eyes
  name: 'dsh-tool-eyes'
  config:
    baseUrl: <baseUrl>
    model: <model>
    timeoutMs: <timeoutMs>

其中 baseUrl 指向 OpenAI-compatible 視覺端點,model 用於指定模型,timeoutMs 用於指定超時參數。

典型用法

在對話中,可以這樣使用:

  • 讓 screen 回答 what is on my screen? 或 describe this image file,並可加 prompt 聚焦區域或細節。
  • 讓 ocr 執行 read all the text on screen 或 transcribe this error dialog。

兩者都可傳 image 路徑;不傳則截圖。

插件捆綁了 lib/capture.ps1 與 lib/ocr.ps1,也可獨立運行:

powershell -NoProfile -ExecutionPolicy Bypass -File lib\capture.ps1 -Prompt "<focus>" -BaseUrl <baseUrl>
powershell -NoProfile -ExecutionPolicy Bypass -File lib\ocr.ps1 -Image <image path>

capture.ps1 可帶 -Prompt 和 -BaseUrl 參數,ocr.ps1 可帶 -Image 參數。

適用場景與注意

適合以下情況:

  • 在 Windows 10/11 上使用 DSH,並想讓 agent 讀取屏幕文字或描述圖片。
  • 希望 ocr 完全本地、無網絡。
  • 希望 screen 指向本地端點,使圖片不出本機。

注意:

  • screen 會將捕獲圖片發送到配置的 baseUrl。
  • 插件以當前 dsh 進程權限運行。安裝前應檢查源碼與許可證;當前許可證爲 MIT。

結尾

經過上面的步驟,dsh-tool-eyes 可以給 DSH agent 增加兩個本地視覺工具:screen 負責描述,ocr 負責逐字提取。

GitHub:https://github.com/go-farther-and-farther/dsh-tool-eyes
目錄頁:當前未提供可確認鏈接。

羽毛球分组比赛记分
小程序二维码

欢迎使用《羽毛球分组比赛记分》微信小程序

小夜