Files
deepseek-harness/packages/vision/image-recognition-http
Pine 768bcd4356 fix(image-recognition): keep the vision key on its own ref; add clear-key
Image recognition and the chat model shared DEEPSEEK_API_KEY: the
image-recognition bundle defaulted apiKeyEnv to the model key, so saving one
overwrote the other. Point the bundle at IMAGE_RECOGNITION_API_KEY and guard
both the provider and the settings card against a stale model ref, so vision
never reads or writes the chat key. Also add a clear-key button, default the
model to qwen3-vl-flash on the DashScope compatible-mode endpoint, and send
file images as base64 with a normalized base URL.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-08-14 23:01:15 +08:00
..

@deepseek-ai/dsh-image-recognition-http

A user-configurable HTTP vision provider for ctx.imageRecognition. It calls an OpenAI-compatible /chat/completions endpoint with the image encoded as a data URL and returns the recognized text.

Config

Key Type Meaning
baseURL string Endpoint base; /chat/completions is appended. Defaults to https://dashscope.aliyuncs.com/compatible-mode/v1 (Aliyun DashScope compatible-mode); $DSH_IMAGE_RECOGNITION_BASE_URL overrides.
apiKey string (secret) Literal key; prefer apiKeyEnv.
apiKeyEnv string (credential-ref) Credential reference resolved per recognition; defaults to IMAGE_RECOGNITION_API_KEY (distinct from the main chat model's DEEPSEEK_API_KEY).
model string Vision model name; defaults to qwen3-vl-flash (an image-recognition-specific default, independent of the chat model).
maxTokens number Generated-token bound; defaults to 2048.

The endpoint and key are editable live through the image-recognition-http settings section. The key never rides a response: it is resolved per recognition from the credentials domain, falling back to the launch environment.

A recognition under an initiating Agent appends the log-only image-recognition/llm-request session event carrying the secret-free request body before dispatch.

Known Limitations and Deferred Work

  • The provider assumes an OpenAI-compatible vision endpoint; non-standard endpoints must be adapted via baseURL/model (or a new provider).
  • file-path inputs require an inferable media type from the extension.