Introduction¶
DeepSeek Harness (DSH) is a pluggable agent development framework. Since text models cannot directly process image data, when developing agents based on text models, generating or editing images typically requires switching to external tools.
The sfyyy/dsh-generation-image plugin solves this problem. It provides a generate_image tool for DSH sessions, allowing agents to call a user-specified OpenAI-compatible image API (such as xiaoyaoapi or a local gateway), persist the generated image as a DSH attachment, and display it as a thumbnail in the session UI.
Core Capabilities¶
The plugin mainly provides the following features:
- Text and Image Generation: Supports pure Text-to-Image generation, as well as editing based on existing attachments through the
referenceImageIdsparameter (Image-to-Image). - Session Integration: Generated images are automatically saved as DSH attachments and rendered as clickable thumbnails on the right side of the chat interface (assistant side).
- Model Safety Isolation: When DeepSeek text models process messages, image blocks are rewritten into text markers, ensuring that the model does not directly access image data.
- Multi-Format Support: Supports APIs returning the
b64_jsonformat, as well as remoteurlformat responses (the plugin automatically downloads the byte stream).
Installation and Enablement¶
The plugin is installed via npm. After installation, restart dsh web to apply the UI changes.
# 使用 dsh CLI 安装
dsh plugin --profile web add @dsh-extension/dsh-generation-image
After installation is complete, find the “Generation Image” option in DSH Web settings to configure it.
Configuration¶
The plugin does not provide credentials by default. Users must configure the API endpoint and key themselves. The configuration priority is: settings page > environment variables > configuration file.
The configuration file path is ~/.dsh/generation-image.json:
{
"enabled": true,
"baseUrl": "https://your-image-endpoint.example/v1",
"apiKey": "sk-xxxx",
"model": "gpt-image-2",
"size": "",
"quality": "auto"
}
Description of the main configuration items:
* baseUrl: Root address of the OpenAI-compatible API (must include /v1), empty by default.
* apiKey / apiKeyEnv: API key, mutually exclusive; fill it in directly or override it via an environment variable.
* size: Default size. Empty means unlimited, or set it to "auto".
* quality: Default quality, "auto" by default.
Environment variable overrides are supported:
* DSH_GENERATION_IMAGE_BASE_URL
* DSH_GENERATION_IMAGE_API_KEY
* DSH_GENERATION_IMAGE_MODEL
* DSH_GENERATION_IMAGE_SIZE
* DSH_GENERATION_IMAGE_QUALITY
Typical Usage¶
Agents call the generate_image tool. This tool accepts the following parameters:
prompt(required): Image description.size(optional): Size constraint. Empty by default (unlimited).quality(optional): Quality setting.autoby default.count(optional): Number of images to generate, limited to 1–4. If the requested count exceeds 1, the plugin automatically splits it into multiplen=1requests.referenceImageIds(optional): Image attachment IDs for the/images/editsendpoint.
Example:
An agent can request modifications to an image by providing referenceImageIds, or omit this parameter to perform text-only generation.
Notes¶
- Bring Your Own Credentials: The plugin does not include an API key. You must configure one yourself.
- Session Restart: After installing a new plugin, be sure to restart the
dsh webprocess so the UI loads the new thumbnail rendering logic. - Environment Variable Overrides: Configuration priority follows the official documentation. Environment variables allow flexible environment switching without modifying the configuration file.
- Ecosystem Affiliation: This plugin is part of the DSH ecosystem, maintained by the community. Its directory address is skillhub.cn. It has no direct organizational relationship with DeepSeek officially.
Conclusion¶
dsh-generation-image is a foundational component for extending multimodal capabilities in DSH. Through a standard OpenAI-compatible interface, it seamlessly integrates image generation into existing agent workflows, while the attachment mechanism solves the problem of data persistence.