Introduction¶
DeepSeek Harness (DSH) uses a plugin-based architecture, allowing developers to extend functionality for specific workflows. In session development, if you need to integrate poetry lookup functionality, you usually have to call an external API or manually enter instructions in the chat. This plugin registers a “Poetry” tab in the session page header, providing a model-token-free lookup solution alongside the “Chat” and “Trajectory” tabs.
Core Positioning¶
An online utility plugin maintained by runcat-tommy. It adds a “Poetry” tab to the session page header to meet the need for directly retrieving Chinese poetry inside the DSH environment, without consuming model quota.
Installation and Activation¶
Before installing, make sure pnpm is installed. Run the following command to install the plugin:
dsh plugin --profile web add dsh-chinese-poetry
After installation, restart dsh web. You can then find the new “Poetry” tab in the header tab bar of any session.
Core Features¶
The plugin adds a query-oriented wrapper and optimizations on top of a public data source:
- No model token required for the session page view: Registers a “Poetry” tab in the session page header. It requires no model API key and calls the public API purely from the frontend.
- Robust data layer: Includes built-in token-bucket rate limiting (6 requests/min for search, 15 requests/min for others), local caching, exponential backoff for 429 responses, and automatic fallback to cache/offline data on consecutive failures, avoiding crashes caused by rate limiting.
- Dynasty correction table: The public API has incorrect dynasty labels for some poets (especially Song Dynasty poets). This plugin includes a correction table for common poets and automatically fixes them when displayed.
- Offline fallback table: Includes about 90 commonly used poems, so the feature can still be demonstrated when offline or when the API is unavailable. Short queries up to 2 characters use a local curated subset; queries with 3 or more characters search the full library.
- Interactive features: Supports entering words/phrases in the search box and filtering by author, dynasty, or form; Feihualing (enter a single character to randomly switch to a poem containing that character); festival topics (Spring Festival, Mid-Autumn Festival, etc.); favorites and history; and Simplified/Traditional Chinese switching.
- Output and integration: Provides a share card image (generates a downloadable PNG); the AI interpretation feature writes a prompt into the DSH session input box, which the user manually confirms and sends, reusing the existing model quota.
Typical Usage¶
- Open a session and click the “Poetry” tab in the header to enter the interface.
- Enter a keyword in the search box, or use the dropdown menus to filter by author, dynasty, or form.
- Use “Feihualing” to enter a single character, then click to switch and view poems containing that character.
- Click the card image option to generate and download a share image.
- Click “AI Interpretation”, insert the interpretation prompt into the input box, then press Enter to send it to the model.
Notes¶
- Version requirement: Requires dsh web 0.1.0-rc.6 or later.
- Data source: Depends on Shiquan (poetry.palemoky.com). This service is free, requires no registration, and has CORS fully open. If queries are slow, it is usually due to server-side response times.
- Quota consumption: The AI interpretation feature is passed through to the DSH session and consumes the user’s existing model quota.
- Storage: Favorites, history, and cache are stored purely locally, with no backend service created.
- Environment dependencies: Before installing, make sure pnpm is installed.