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"

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.3.tar.gz (20.4 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.3-py2.py3-none-any.whl (20.5 MB view details)

Uploaded Python 2Python 3

File details

Details for the file smolagents_capsule-0.1.3.tar.gz.

File metadata

  • Download URL: smolagents_capsule-0.1.3.tar.gz
  • Upload date:
  • Size: 20.4 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.3.tar.gz
Algorithm Hash digest
SHA256 c6665d3624496ed571fc9d4b908489e2dd959bb207d20132b7f9f3ca9f7c102f
MD5 0be7b24759f373e919c3cf0d670bd171
BLAKE2b-256 5ef4129a50c80ab0bacda8b8cdd6e767840256e33470627a3b10a4de5e1174b2

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for smolagents_capsule-0.1.3-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 ceebe05a44262e69d041000c3e39857a4b87b842cf43f0e87539987cb4fdd3d6
MD5 1362a3435430f9776228c90ce3b702b4
BLAKE2b-256 79080c5ca41191fd790abeb93da00ad9f4623fd39ed0a9667eab5ba21f90dfb9

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