HiSeax/dsh-image-to-text ↗★ 0

dsh-image-to-text

让纯文本模型通过视觉API读取并描述图片 适合使用无多模态能力的纯文本模型但仍需处理图片输入的用户。

套件
dsh-image-to-text
相容性
待驗證
Harness 依賴範圍
^0.1.0-rc.6
Cordis 依賴範圍
^4.0.1
版本
0.1.2
授權
MIT
最近更新
2026年8月15日

安裝

此插件尚未提供可驗證的 bundle,或相容性檢查未通過。請先閱讀倉庫說明。 閱讀完整 README ↗

Configuration

Plugin row config fields:

FieldDefaultMeaning
pythonPathWindows probes C:\Program Files\Python313\python.exe, else pythonPython executable path or PATH command
providersbuilt-in 7 provider templatesOverride by name (optionally model), or add new providers
bypassImageGatetrueWrap llm.resolveModelInfo to admit image prompts
rewriteImageBlockstrueRewrite image blocks to local paths before text-only adapters

Custom API URL / key (plugin config)

- insert:
    - id: image-to-text
      name: 'dsh-image-to-text'
      config:
        pythonPath: 'python'
        providers:
          # Override a built-in provider: only name (and optionally model) is needed
          - name: zhipu
            apiKey: 'your-zhipu-key'
            endpoint: 'https://open.bigmodel.cn/api/paas/v4/chat/completions'
          # Add a fully custom OpenAI-compatible provider
          - name: my-vision
            model: 'vision-model'
            apiKey: 'sk-xxx'
            endpoint: 'https://api.example.com/v1/chat/completions'
            format: openai
            priority: 1

Built-in provider names: zhipu, gemini (shared by several Gemini models), grok. New providers need the full name/model/apiKey/endpoint/format/priority.

Custom API URL / key (environment variables)

Named by provider name (non-alphanumeric → _, uppercase):

IMAGE_TO_TEXT_API_KEY_ZHIPU=your-key
IMAGE_TO_TEXT_ENDPOINT_ZHIPU=https://open.bigmodel.cn/api/paas/v4/chat/completions

Environment variables are read on every call and never written to disk.

Usage

Upload an image in a session, or the model sees an image in context and calls image_to_text:

{
  "images": ["C:\\path\\to\\image.png"]
}

Optional arguments: model (force a specific model), prompt (custom prompt). Returns:

{
  "text": "OCR and description",
  "provider": "gemini",
  "model": "gemini-3.6-flash"
}