Introduction¶
DeepSeek Harness advocates a “everything-is-a-plugin” extension approach. When complex local computation is required, calling a remote API directly is often insufficient. SymPy-Calculate provides a local tool based on the minimal preset, enabling the Agent to run SymPy code directly on the host machine.
Plugin Introduction¶
- Name: SymPy-Calculate
- Maintainer: 11350613
- Category: Workflow
- License: MIT
This plugin adds a stateless tool sympy_calculate. It launches a new process in the local SymPy development checkout directory to perform calculations on a complete Python script.
Core Capabilities¶
- Adds the stateless tool
sympy_calculate. - Runs complete Python scripts in the local SymPy checkout.
- Each invocation has a 120-second timeout.
- stdout and stderr output are each limited to 2,000,000 characters.
Environment Requirements¶
- DeepSeek Harness: 0.2.0-rc.2
- Node.js: ^22.19.0 or >=24.0.0
- SymPy: Local checkout (default path is
~/sympy-dev/sympy) - Python: 3.x, with
venvandpipsupport required - Platform: Tested on Ubuntu 24.04.4 LTS.
Installation and Configuration¶
Before installation, configure the local SymPy environment first. The setup steps are as follows:
- Install the venv tools (if missing):
sudo apt install -y python3-venv python3-pip
- Create the SymPy checkout directory and clone the repository:
mkdir -p ~/sympy-dev
git clone https://github.com/sympy/sympy.git ~/sympy-dev/sympy
- Create a virtual environment and install SymPy:
python3 -m venv ~/sympy-dev/sympy/venv
~/sympy-dev/sympy/venv/bin/python -m pip install -e ~/sympy-dev/sympy
echo 'venv/' >> ~/sympy-dev/sympy/.git/info/exclude
- (Optional) Configure environment variables. By default,
~/sympy-dev/sympyis used as the root directory, and the interpreter is resolved in priority order tovenv/bin/pythonorpython3. To customize, setSYMPY_ROOTandSYMPY_PYTHONin the environment variables used when starting Harness.
After configuration is complete, install the DSH plugin. The plugin must be installed in the web profile:
npx --yes @deepseek-ai/dsh@0.2.0-rc.2 plugin --profile web add https://codeload.github.com/11350613/SymPy-Calculate/tar.gz/v1.0.4
Usage Example¶
sympy_calculate accepts a JSON object containing a complete Python script. Each invocation starts a new interpreter process, so it is recommended to combine related batch calculations into a single script.
Input:
{
"code": "from sympy import *\n\nx = symbols('x')\nprint(integrate(x**2 / (1 + x**4), (x, -oo, oo)))"
}
Output:
sqrt(2)*pi/2
Caveats¶
- Security:
sympy_calculateexecutes arbitrary Python code with the current user’s privileges and inherits environment variables. It is not sandboxed. Use it only in sessions with trusted models and permission policies. - Platform: The plugin has been tested on Ubuntu 24.04.4 LTS; compatibility issues may exist on other platforms.
- Output handling: stdout and stderr are merged into the output. If the script exits with a non-zero exit code, the tool treats it as an error.
- Performance: Because each invocation starts a new process, importing SymPy incurs overhead.