tuofangzhe/dsh-plugin-image-gen ↗★ 0
@dopilot/dsh-plugin-image-gen
OpenAI-compatible image generation tool for DeepSeek Harness
安装
npx -p @deepseek-ai/dsh dsh plugin --profile web add github:tuofangzhe/dsh-plugin-image-gen说明文档
阅读完整 README ↗Configuration
In the target profile's cordis.patch.yml, override the bundle row by id:
- id: dopilot-image-gen
config:
providers:
openai:
baseURL: https://api.openai.com/v1
apiKeyEnv: OPENAI_IMAGE_API_KEY
defaultModel: gpt-image-1
models: [gpt-image-1]
responseFormat: png
timeoutMs: 120000
gateway:
baseURL: https://images.example.com/openai/v1
apiKeyEnv: CUSTOM_IMAGE_API_KEY
defaultModel: organization/image-model
responseFormat: webp
timeoutMs: 180000
defaultProvider: openai
maxImagesPerCall: 4
outputDir: generated-images
maxResponseBytes: 134217728
maxImageBytes: 20971520
maxTotalImageBytes: 83886080
maxErrorChars: 500
toolTimeoutGraceMs: 30000
apiKeyEnv is a credential reference name, not a secret value. It is resolved through the DSH credentials service for every call and is never cached. Omit it for a gateway that needs no Authorization header.
| Field | Meaning and default |
|---|---|
providers | Optional route map. Missing or empty keeps the plugin dormant and registers no tool. |
providers.*.baseURL | Absolute HTTP(S) URL without credentials, query, or fragment. Trailing slashes are removed. |
providers.*.apiKeyEnv | Optional credential reference using POSIX shell-identifier syntax. |
providers.*.defaultModel | Required non-empty default image model. |
providers.*.models | Optional model allowlist; omitted or empty means unrestricted. |
providers.*.responseFormat | Actual returned encoding: png (default), jpeg, or webp. The plugin does not transcode provider output. |
providers.*.timeoutMs | Provider request deadline; default 120000. |
defaultProvider | Required with multiple providers; inferred with exactly one. |
maxImagesPerCall | 1–10; default 4. |
outputDir | Safe normalized relative path; default generated-images. |
maxResponseBytes | Streaming HTTP body limit; default 128 MiB. |
maxImageBytes | Per decoded image limit; default 20 MiB. |
maxTotalImageBytes | Per-call decoded-image limit; default 80 MiB. |
maxErrorChars | Provider/attachment error excerpt, 64–4000 Unicode code points; default 500. |
toolTimeoutGraceMs | Cooperative tool deadline margin above the slowest provider; default 30000 ms. |
Missing or empty providers is an intentional dormant state: DSH starts normally, the plugin logs how to configure the profile, and generate_image is not registered. Once providers is non-empty, invalid values fail during plugin loading. The combined slowest provider timeout and tool grace may not exceed 2_147_483_647 ms. Byte limits must satisfy maxImageBytes <= maxTotalImageBytes <= maxResponseBytes.