feat: add E2B sandbox support #35
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Add a new
E2BREPLenvironment that runs Python code in E2B sandboxes, following the same HTTP broker pattern asModalREPLandPrimeREPL.Changes
rlm/environments/e2b_repl.py- FullE2BREPLimplementation using HTTP broker patternexamples/e2b_repl_example.py- Example demonstrating basic code execution and LLM queriesrlm/environments/__init__.py- Register "e2b" environmentrlm/core/types.py- Add "e2b" toEnvironmentTypepyproject.toml- Adde2boptional dependency (e2b-code-interpreter>=0.0.11)Key Implementation Details
e2b-code-interpreterSDK withSandbox.create()APIsandbox.get_host(port)for public URL accessllm_query(),llm_query_batched(),FINAL_VAR()Usage
Example Output
Test Plan
FINAL_VAR()extracts variables correctly