DeepSeek Harness Plugin: dsh-tools-deepseek-media

Introduction

When developing agents with DeepSeek Harness (DSH), calling DeepSeek’s media API directly requires you to handle authentication, file path validation, and size limits on your own. DSH itself does not include built-in tools for OCR, ASR, or TTS, which means developers have to write additional wrappers or switch to external services. This article introduces a plugin that encapsulates DeepSeek’s OCR, ASR, and TTS capabilities into three DSH agent tools and provides a settings page for managing your API Key.

What It Is

dsh-tools-deepseek-media is a DeepSeek Harness plugin maintained by oh-wang. Through DSH’s plugin mechanism, it exposes DeepSeek’s media APIs (OCR, speech recognition, and speech synthesis) as three agent tools and provides a settings page for configuring and storing your API Key. The plugin performs local size and path validation before sending requests to DeepSeek’s API endpoints.

Core Features

The plugin provides three tools that can be invoked via DSH agents after configuring the API Key:

  • deepseek_ocr: Recognizes text in PDF / DOC(X) / PPT(X) / PNG / JPEG / WebP / GIF / BMP / TIFF files, returning per-page text and finish_reason. Local constraints: file ≤ 100 MiB, path must be within the session workspace.
  • deepseek_asr: Transcribes 16-bit PCM WAV or Ogg Opus audio with automatic language detection. Local constraints: audio ≤ 8 MiB, duration ≤ 120 seconds, container format validated via header check (no shell calls or transcoding allowed).
  • deepseek_tts: Synthesizes speech, supporting stella / tide voices, and outputs a 24 kHz 16-bit WAV file to the session workspace. Local constraints: billable character count ≤ 10,000 (CJK characters are double-billed), file body ≤ 64 KiB.

When DEEPSEEK_API_KEY is not configured, these three tools are not registered and will not appear in the agent list. Once a key is configured (via environment variable or the settings page), the tools become immediately available.

Installation & Enabling

Ensure your DSH version is ≥ 0.2.2-rc.1. Run the following command in your terminal:

dsh plugin --profile <name> add github:oh-wang/dsh-tools-deepseek-media

After installation, find the “DeepSeek media” entry in DSH’s settings page and configure your API Key. Configuration is managed through DSH’s credential service; the Key will never appear in plaintext in logs or error messages.

Typical Usage

In a DSH agent or script, you can call the tools directly:

// OCR example
await ctx.call('deepseek_ocr', {
  file: 'invoice.pdf',
  purpose: 'text_recognition'
});
// Example return structure:
// {
//   "page_count": 1,
//   "pages": [
//     {
//       "index": 0,
//       "text": "Invoice total: 1,280.00 CNY\nOrder No. DS-20261117-0042\nInvoice total: 1280.00 CNY\nDeepSeek OCR test",
//       "finish_reason": "stop"
//     }
//   ]
// }
// ASR example
await ctx.call('deepseek_asr', {
  file: 'speech.wav'
});
// Example return structure:
// {
//   "text": "Hello, this is a DeepSeek speech synthesis test. Today is November 17, 2026.",
//   "duration_ms": 6240
// }
// TTS example
await ctx.call('deepseek_tts', {
  text: 'Hello, this is a DeepSeek speech synthesis test.',
  voice: 'stella'
});
// Output file: tts/20261118-014134-9613d2d8.wav (24 kHz 16-bit WAV), file size ~178 KB, billable characters ~42

Use Cases & Notes

  • Ideal for DSH agent development scenarios that require text extraction from PDFs and images, audio transcription, or speech synthesis.
  • The plugin runs with the permissions of the current DSH process. It is recommended to review the source code and license (MIT) before installation.
  • All file operations are confined to the session workspace. The plugin rejects paths containing ../, absolute paths outside the workspace, and symbolic links that attempt to escape the workspace.
  • The API Key is read exclusively via ctx.credentials and is never written to disk or embedded in error messages.

Summary

dsh-tools-deepseek-media provides DeepSeek Harness with three media processing capabilities—OCR, ASR, and TTS—lowering the barrier to entry through local validation and DSH’s credential service. Within the DSH ecosystem, plugins like this bring the “everything is a plugin” philosophy to life, enabling developers to compose tools as needed to build intelligent agents.

  • Directory page: https://www.skillhub.cn/plugins/oh-wang/dsh-tools-deepseek-media
  • GitHub: https://github.com/oh-wang/dsh-tools-deepseek-media
羽毛球分组比赛记分
小程序二维码

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

Xiaoye