Running DSPy Programs
Execute and test your DSPy programs safely with DSPy Code.
Quick Run
Run Generated Code
After generating code:
Executes the last generated code in a sandboxed environment.
Run Specific File
Sandbox Execution
All code runs in a secure sandbox:
- â Isolated environment
- â Resource limits
- â Timeout protection
- â Safe execution
Execution Output
Running my_program.py...
Output:
âââââââââââââââââââââââââââââ
Text: I love this!
Sentiment: positive
Confidence: 0.95
âââââââââââââââââââââââââââââ
â Execution completed (2.3s)
Testing
Test with custom inputs:
Prompts for test inputs and shows results.
Debugging
Run with debug output:
Shows: - Execution trace - Variable values - Error details
Common Issues
Timeout
Solution: Optimize code or increase timeout in config
Import Error
Solution: Install required dependencies
Runtime Error
Solution: Check error message, fix code, run /validate first