Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,15 @@

# Changelog

## 0.0.3

- Removed the `E2BProvider` lifecycle helper. Use the E2B SDK to create,
configure, connect to, and kill sandboxes, then wrap them with `E2BSandbox`.

## 0.0.2

- Added the `E2BProvider` lifecycle helper.

## 0.0.1

- Initial E2B sandbox integration for Deep Agents.
25 changes: 13 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,32 +11,33 @@ pip install langchain-e2b
```

```python
from langchain_e2b import E2BProvider
from e2b import Sandbox
from langchain_e2b import E2BSandbox

provider = E2BProvider()
sandbox = provider.get_or_create()
e2b_sandbox = Sandbox.create()
backend = E2BSandbox(sandbox=e2b_sandbox)

try:
result = sandbox.execute("echo hello")
result = backend.execute("echo hello")
print(result.output)
finally:
provider.delete(sandbox_id=sandbox.id)
e2b_sandbox.kill()
```

## What is this?

`langchain-e2b` adapts E2B sandboxes to the Deep Agents sandbox protocol. It
uses the low-level `e2b` SDK so Deep Agents can create or reconnect to
sandboxes, run shell commands, and move files through the standard Deep Agents
sandbox interface.
`langchain-e2b` adapts an existing E2B sandbox to the Deep Agents sandbox
protocol. It uses the low-level `e2b` SDK so Deep Agents can run shell commands
and move files through the standard Deep Agents sandbox interface.

Use `E2BProvider` when you want the package to manage sandbox lifecycle. Use
`E2BSandbox` directly when you already have an E2B SDK sandbox object.
This package intentionally does not hide E2B sandbox lifecycle management. Use
the E2B SDK to create, connect to, configure, and kill sandboxes, then pass the
connected sandbox object to `E2BSandbox`.

## Contributing

Contributions are welcome. Keep the adapter focused on implementing the Deep
Agents sandbox protocol over the official E2B SDK.
Agents sandbox backend protocol over the official E2B SDK.

## Development

Expand Down
3 changes: 1 addition & 2 deletions langchain_e2b/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
"""E2B sandbox integration for Deep Agents."""

from langchain_e2b.provider import E2BProvider
from langchain_e2b.sandbox import E2BSandbox

__all__ = ["E2BProvider", "E2BSandbox"]
__all__ = ["E2BSandbox"]
2 changes: 1 addition & 1 deletion langchain_e2b/_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

# Keep the `x-release-please-version` annotation — release-please uses it to
# bump `__version__` in sync with `pyproject.toml` on every release PR.
__version__ = "0.0.2" # x-release-please-version
__version__ = "0.0.3" # x-release-please-version
136 changes: 0 additions & 136 deletions langchain_e2b/provider.py

This file was deleted.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ classifiers = [
"Topic :: Scientific/Engineering :: Artificial Intelligence",
]

version = "0.0.2"
version = "0.0.3"
requires-python = ">=3.11,<4.0"
dependencies = [
"deepagents>=0.6.0,<0.7.0",
Expand Down
6 changes: 6 additions & 0 deletions tests/unit_tests/test_import.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,9 @@

def test_import_e2b() -> None:
assert langchain_e2b is not None


def test_public_exports_only_sandbox() -> None:
assert langchain_e2b.__all__ == ["E2BSandbox"]
assert hasattr(langchain_e2b, "E2BSandbox")
assert not hasattr(langchain_e2b, "E2BProvider")
159 changes: 0 additions & 159 deletions tests/unit_tests/test_provider.py

This file was deleted.

Loading
Loading