Metadata-Version: 2.4
Name: langchain-capsule
Version: 0.1.0
Summary: Capsule sandbox integration for LangChain — run code in isolated WebAssembly sandboxes
Project-URL: Homepage, https://github.com/mavdol/capsule
Project-URL: Repository, https://github.com/mavdol/langchain-capsule
Author: Capsule Contributors
License: MIT
License-File: LICENSE
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Requires-Dist: capsule-run>=0.6.3
Requires-Dist: langchain-core>=0.3.0
Provides-Extra: test
Requires-Dist: pytest; extra == 'test'
Requires-Dist: pytest-asyncio; extra == 'test'
Description-Content-Type: text/markdown

# langchain-capsule

[Capsule](https://github.com/mavdol/capsule) integration for LangChain.

## What is this?

`langchain-capsule` gives LangChain agents 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

```bash
pip install langchain-capsule
```

## Usage

The package provides tools for executing code inside an isolated environment.

```python
import asyncio
from langchain_capsule import CapsulePythonTool, CapsuleJSTool

# Python Example
python_tool = CapsulePythonTool()
result = python_tool.run("1 + 1")
print(result) # "2"

# JavaScript / TypeScript Example
js_tool = CapsuleJSTool()
result = asyncio.run(js_tool.arun("1 + 2"))
print(result) # "3"
```

## Check our main repo

Visit [Capsule](https://github.com/mavdol/capsule) repository for more information.

## License

MIT License
