Files
deepseek-harness/examples/python-sdk-agent/README.md
T
Tianyi Cui f0f9b294dd docs(python): make the dsh profile runtime current
Document dsh as the only application launcher across architecture, CLI, SDK, app-boot, Python package, contributor, tutorial, and example references. Explain explicit home selection, profile and patch precedence, persistent external plugin installation, the Node-free runtime path, and the absence of complete-config or ~/.dsh fallbacks.

Record the Python profile-runtime decision and update the active naming, installed-wheel, and SEA packaging notes with precise supersession. Regenerate the configuration catalog and module graph after deleting the carrier, update both reviewed languages and pairing records, and classify the retained standalone Cordis files as lower-level test fixtures rather than launch interfaces.
2026-08-24 17:28:27 +08:00

2.4 KiB

python-sdk-agent

English | 中文

Runnable Python SDK example over the sole application launcher, dsh --profile sdk. The Python client owns JSON-RPC stdio; the profile owns the agent composition, persistence, permissions, and plugins.

Run the minimal agent

Install deepseek-harness-sdk, export a model credential, then supply an isolated Harness home and workspace:

export DEEPSEEK_API_KEY=sk-your-key-here
python examples/python-sdk-agent/minimal.py \
  --dsh-home /absolute/path/to/example-dsh-home \
  --workspace /absolute/path/to/disposable-workspace \
  --session-id example-001 \
  "Inspect the repository and fix the failing tests."

Set DEEPSEEK_BASE_URL for a compatible proxy, DSH_MODEL for the default model, or DSH_SYSTEM_PROMPT for the deployment persona. --model and --profile override their script defaults. The selected home stores the generated profile and Zstandard session logs under sessions/; the script never reads ~/.dsh implicitly.

minimal.patch.yml is an ordered overlay on the shipped SDK profile. It preserves the SDK application bundle but narrows model-visible behavior to:

  • owner-scoped persistent bash
  • str_replace_editor with view, create, str_replace, and insert

The patch omits Harness identity and runtime-context messages, local instruction discovery, skills, compaction, plan/goal/task/web/subagent/workflow tools, and the profile's one-shot Bash. It inserts the local PTY and persistent Bash providers and sets the editor output limit to 16,000 characters.

This variant is intentionally POSIX-only. Its persistent PTY and editor can modify any path available to the runtime process, so use a disposable checkout or container.

Add plugins

Use the runtime wheel's dsh command against the same explicit home for persistent profile changes:

export DSH_HOME=/absolute/path/to/example-dsh-home
dsh plugin --profile sdk add file:/absolute/path/to/my-plugin-bundle

The Python call can also pass additional absolute patch paths in patches=(...); later files win. A selected profile must retain @deepseek-ai/dsh-sdk-app or another JSON-RPC server row. Complete standalone Cordis files in this directory remain test fixtures for lower-level composition coverage; they are not Python SDK launch interfaces.

See the Python SDK tutorial and SDK reference.