Skip to main content
Provides tools for connecting to sandbox Docker containers.

react_agent.custom_tools.sandbox_tools.execute_in_sandbox

View Source Execute a shell command directly inside the target Daytona sandbox container asynchronously. This tool interfaces with the Daytona process manager to run arbitrary commands (like Maven or Dotnet CLI) within an isolated workspace. It seamlessly pipes stdout and stderr via runtime.stream_writer back to the LangGraph execution environment so the user can observe real-time compiler output via LanggraphCustomEventKeys. Arguments:
  • sandbox_type SandboxType - The target service architecture enum (e.g., DOTNET_10_SANDBOX).
  • command str - The raw shell command or script to run.
  • timeout int - The execution timeout in seconds.
  • env_vars dict[str, Any] | None - Dictionary of environment variables to inject.
  • runtime Annotated[ToolRuntime, InjectedToolArg] - Injected tool runtime context.
Returns: tuple[str, int]: A tuple of the combined output (stdout/stderr) and the exit code. Raises:
  • DaytonaError - If communicating with the Daytona daemon fails.

react_agent.custom_tools.sandbox_tools.download_file_from_sandbox

View Source Retrieve the contents of a file from a specified service container using the Daytona FS API. Used primarily to extract the generated JSON execution results after a query validation harness finishes running in the sandbox. Arguments:
  • sandbox_type SandboxType - The target service architecture enum.
  • remote_path str - The absolute path to the file on the remote container’s filesystem.
  • runtime Annotated[ToolRuntime, InjectedToolArg] - Injected tool runtime context.
Returns:
  • str - The UTF-8 decoded string content of the requested file.
Raises:
  • DaytonaError - If the file does not exist or Daytona communication fails.