Skip to main content

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

smolagents_capsule-0.1.0.tar.gz (19.7 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

smolagents_capsule-0.1.0-py2.py3-none-any.whl (19.8 MB view details)

Uploaded Python 2Python 3

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

Hashes for smolagents_capsule-0.1.0.tar.gz
Algorithm Hash digest
SHA256 b148d647d8f1d42bfa083d20cd1532558c2c24671943e6da0cd836bbb071c9ef
MD5 22814f54353f861b913284d68a9e75e8
BLAKE2b-256 f144f7fd11fe38512fbb81ddf9ee696cf630615b9dd13940e4070ff636a78fcb

See more details on using hashes here.

File details

Details for the file smolagents_capsule-0.1.0-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for smolagents_capsule-0.1.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 57b2cc65b52c448760bd01615b80b168bc70adebf93ccf0fd07f0b8d4db7915a
MD5 dbfe037ddf7dbd4a8af0e327b4668d3b
BLAKE2b-256 b4201713db6be29731439c19f4c7ff62c491a14e019adcdf444acb7c8ee62d87

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page