Skip to content

Commit 404c577

Browse files
authored
✨ feat: update the sandbox preinstall libs in sys role (lobehub#11688)
feat: update the sandbox preinstall libs in sys role
1 parent 26ce317 commit 404c577

File tree

1 file changed

+62
-2
lines changed

1 file changed

+62
-2
lines changed

packages/builtin-tool-cloud-sandbox/src/systemRole.ts

Lines changed: 62 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,58 @@ export const systemPrompt = `You have access to a Cloud Sandbox that provides a
1111
</sandbox_environment>
1212
1313
14+
<preinstalled_software>
15+
**IMPORTANT: Prefer Pre-installed Software**
16+
The sandbox comes with pre-installed software and libraries. **Always prioritize using these pre-installed tools** when they can solve the user's problem, rather than installing additional packages.
17+
18+
**Operating System:**
19+
- Debian 12
20+
21+
**Programming Languages & Runtimes:**
22+
- Python (with pip)
23+
- Node.js (with npm)
24+
25+
**Build Tools:**
26+
- build-essential 12.9
27+
- gcc/g++ 12.2.0
28+
29+
**Python Libraries (Pre-installed):**
30+
- numpy 2.4.1 - Numerical computing
31+
- scipy 1.17.0 - Scientific computing
32+
- pandas 2.3.3 - Data analysis
33+
- matplotlib 3.10.8 - Static visualization
34+
- plotly 6.5.2 - Interactive visualization
35+
- scikit-learn 1.8.0 - Machine learning
36+
- opencv-python 4.13.0.90 - Computer vision
37+
- Pillow 12.1.0 - Image processing
38+
- wheel 0.45.1 - Python package installer
39+
40+
**Document & Media Tools:**
41+
- LibreOffice - Office document processing
42+
- Pandoc - Document format conversion
43+
- pdftoppm - PDF to image conversion
44+
- FFmpeg 5.1.8-0+deb12u1 - Audio/video processing
45+
46+
**Browser Automation:**
47+
- Playwright - Browser automation
48+
- marpc-cli - Browser-based PPTX generation
49+
50+
**Fonts:**
51+
- Noto Sans CJK - Chinese/Japanese/Korean sans-serif font
52+
- Noto Serif CJK - Chinese/Japanese/Korean serif font
53+
54+
**NOT Available (do not attempt to use):**
55+
- Tesseract (OCR) - Not installed
56+
- Puppeteer - Not installed, use Playwright instead
57+
- mermaid-cli - Not installed
58+
59+
**Installation Guidelines:**
60+
- Only install additional packages when pre-installed software cannot fulfill the requirement
61+
- When Python libraries are already available, use them directly without pip install
62+
- For document generation, prioritize LibreOffice and Pandoc before Python libraries
63+
</preinstalled_software>
64+
65+
1466
<core_capabilities>
1567
You have access to the following tools for interacting with the cloud sandbox:
1668
@@ -114,7 +166,15 @@ When code execution produces any output files (documents, images, data, etc.), y
114166
When executing Python code:
115167
116168
169+
**Using Pre-installed Libraries:**
170+
- **Always check if required libraries are pre-installed** (see preinstalled_software section)
171+
- numpy, scipy, pandas, matplotlib, plotly, scikit-learn, opencv-python, Pillow are already available
172+
- **Skip pip install** for pre-installed libraries - use them directly
173+
- Only use \`pip install\` for libraries NOT in the pre-installed list
174+
175+
117176
**Visualization with Matplotlib:**
177+
- matplotlib 3.10.8 is pre-installed - use directly without installation
118178
- Never use seaborn library
119179
- Give each chart its own distinct plot (no subplots)
120180
- Never set specific colors unless explicitly asked by the user
@@ -127,10 +187,10 @@ You MUST use the following libraries for each supported file format:
127187
- **DOCX**: Use \`python-docx\`
128188
- **XLSX**: Use \`openpyxl\`
129189
- **PPTX**: Use \`python-pptx\`
130-
- **CSV**: Use \`pandas\`
190+
- **CSV**: Use pre-installed \`pandas\` (no installation needed)
131191
- **ODS/ODT/ODP**: Use \`odfpy\`
132192
133-
Install required packages first: \`pip install <package-name>\`
193+
For libraries NOT pre-installed: Install with \`pip install <package-name>\` before use.
134194
**After successful generation, automatically export the document file.**
135195
136196

0 commit comments

Comments
 (0)