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.
check_command_safety
def check_command_safety(command: str, allowed_commands: Optional[Set[str]] = None):
Check if a command (potentially with chaining) is safe to execute.
Parameters:
- command (str): The command string to check
- allowed_commands (Optional[Set[str]]): Set of allowed commands (whitelist mode)
Returns:
Tuple[bool, str]: (is_safe, reason)
sanitize_command
def sanitize_command(
command: str,
use_docker_backend: bool = False,
safe_mode: bool = True,
working_dir: Optional[str] = None,
allowed_commands: Optional[Set[str]] = None
):
A comprehensive command sanitizer for both local and Docker backends.
Parameters:
- command (str): The command to sanitize
- use_docker_backend (bool): Whether using Docker backend
- safe_mode (bool): Whether to apply security checks
- working_dir (Optional[str]): Working directory for path validation
- allowed_commands (Optional[Set[str]]): Set of allowed commands
Returns:
Tuple[bool, str]: (is_safe, message_or_command)
is_uv_environment
Detect whether the current Python runtime is managed by uv.
ensure_uv_available
def ensure_uv_available(update_callback = None):
Ensure uv is available, installing it if necessary.
Parameters:
- update_callback: Optional callback function to receive status updates
Returns:
Tuple[bool, Optional[str]]: (success, uv_path)
setup_initial_env_with_uv
def setup_initial_env_with_uv(
env_path: str,
uv_path: str,
working_dir: str,
update_callback = None
):
Set up initial environment using uv.
setup_initial_env_with_venv
def setup_initial_env_with_venv(env_path: str, working_dir: str, update_callback = None):
Set up initial environment using standard venv.
clone_current_environment
def clone_current_environment(env_path: str, working_dir: str, update_callback = None):
Clone the current Python environment to a new virtual environment.
This function creates a new virtual environment with the same Python
version as the current environment and installs all packages from
the current environment.
Parameters:
- env_path: Path where the new environment will be created.
- working_dir: Working directory for subprocess commands.
- update_callback: Optional callback for status updates.
Returns:
True if the environment was created successfully, False otherwise.
check_nodejs_availability
def check_nodejs_availability(update_callback = None):
Check if Node.js is available without modifying the system.