Capsule sandbox integration for smolagents — run code in isolated WebAssembly sandboxes
Project description
smolagents-capsule
Capsule integration for smolagents
What is this?
smolagents-capsule gives smolagents the ability to safely execute Python and JavaScript code in an isolated WebAssembly sandbox.
The WebAssembly sandbox files (.wasm) are already bundled inside this package; no configuration or network request is necessary to execute the sandboxes dynamically.
Installation
pip install smolagents-capsule
Usage
The package provides tools for executing code inside an isolated environment.
from smolagents_capsule import CapsulePythonTool, CapsuleJSTool
# Python Example
python_tool = CapsulePythonTool()
result = python_tool.forward("1 + 1")
print(result) # "2"
# JavaScript / TypeScript Example
js_tool = CapsuleJSTool()
result = js_tool.forward("1 + 2")
print(result) # "3"
Check our main repo
Visit Capsule repository for more information.
License
MIT License
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file smolagents_capsule-0.1.0.tar.gz.
File metadata
- Download URL: smolagents_capsule-0.1.0.tar.gz
- Upload date:
- Size: 19.7 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b148d647d8f1d42bfa083d20cd1532558c2c24671943e6da0cd836bbb071c9ef
|
|
| MD5 |
22814f54353f861b913284d68a9e75e8
|
|
| BLAKE2b-256 |
f144f7fd11fe38512fbb81ddf9ee696cf630615b9dd13940e4070ff636a78fcb
|
File details
Details for the file smolagents_capsule-0.1.0-py2.py3-none-any.whl.
File metadata
- Download URL: smolagents_capsule-0.1.0-py2.py3-none-any.whl
- Upload date:
- Size: 19.8 MB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
57b2cc65b52c448760bd01615b80b168bc70adebf93ccf0fd07f0b8d4db7915a
|
|
| MD5 |
dbfe037ddf7dbd4a8af0e327b4668d3b
|
|
| BLAKE2b-256 |
b4201713db6be29731439c19f4c7ff62c491a14e019adcdf444acb7c8ee62d87
|