Documentation Index
Fetch the complete documentation index at: https://docs.camel-ai.org/llms.txt
Use this file to discover all available pages before exploring further.
E2BInterpreter
class E2BInterpreter(BaseInterpreter):
E2B Code Interpreter implementation.
Parameters:
- require_confirm (bool, optional): If True, prompt user before running code strings for security. (default: :obj:
True) Environment Variables:
- E2B_API_KEY: The API key for authenticating with the E2B service.
- E2B_DOMAIN: The base URL for the E2B API. If not provided, will use the default E2B endpoint.
init
def __init__(self, require_confirm: bool = True):
del
Destructor for the E2BInterpreter class.
This method ensures that the e2b sandbox is killed when the
interpreter is deleted.
run
def run(self, code: str, code_type: str = 'python'):
Executes the given code in the e2b sandbox.
Parameters:
- code (str): The code string to execute.
- code_type (str): The type of code to execute (e.g., ‘python’, ‘bash’). (default: obj:
python)
Returns:
str: The string representation of the output of the executed code.
supported_code_types
def supported_code_types(self):
Provides supported code types by the interpreter.
update_action_space
def update_action_space(self, action_space: Dict[str, Any]):
Updates action space for python interpreter
execute_command
def execute_command(self, command: str):
Execute a command can be used to resolve the dependency of the
code.
Parameters:
- command (str): The command to execute.
Returns:
str: The output of the command.