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.2.tar.gz (41.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.2-py2.py3-none-any.whl (3.9 kB view details)

Uploaded Python 2Python 3

File details

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

File metadata

  • Download URL: smolagents_capsule-0.1.2.tar.gz
  • Upload date:
  • Size: 41.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.2.tar.gz
Algorithm Hash digest
SHA256 97124124092151ff67ee729fc48295347470cc980726d1ed26b4da46f743c188
MD5 f9c6bac89bc1772f9286c2a0914a262c
BLAKE2b-256 b4ea33b96752c027f85ae1a0747ec9fc568fa5a2c5296ec9e5f33fd0e9e07806

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for smolagents_capsule-0.1.2-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 8a04e91b2e6144a51d45c7c75f388ea76ac3b621b3635712a783030d8db54777
MD5 21424d7451cfa6d71a2d638f267ee2db
BLAKE2b-256 03caa9a209c4e415d8686242737b69780af3a2bb9ab524afc77103076a2f58ae

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