LangChain Reference home pageLangChain ReferenceLangChain Reference
  • GitHub
  • Main Docs
Deep Agents
LangChain
LangGraph
Integrations
LangSmith
  • Overview
  • Client
  • AsyncClient
  • Run Helpers
  • Run Trees
  • Evaluation
  • Schemas
  • Utilities
  • Wrappers
  • Anonymizer
  • Testing
  • Expect API
  • Middleware
  • Pytest Plugin
  • Deployment SDK
  • RemoteGraph
⌘I

LangChain Assistant

Ask a question to get started

Enter to send•Shift+Enter new line

Menu

OverviewClientAsyncClientRun HelpersRun TreesEvaluationSchemasUtilitiesWrappersAnonymizerTestingExpect APIMiddlewarePytest PluginDeployment SDKRemoteGraph
Language
Theme
Pythonlangsmithsandbox_async_sandboxAsyncSandboxrun
Method●Since v0.6

run

Execute a command in the sandbox asynchronously.

Copy
run(
  self,
  command: str,
  *,
  timeout: int = 60,
  env: Optional[dict[str, str]] = None,
  cwd: Optional[str] = None,
  shell: str = '/bin/bash'
) -> ExecutionResult

Parameters

NameTypeDescription
command*str

Shell command to execute.

timeoutint
Default:60

Command timeout in seconds.

envOptional[dict[str, str]]
Default:None

Environment variables to set for the command.

cwdOptional[str]
Default:None

Working directory for command execution. If None, uses sandbox default.

shellstr
Default:'/bin/bash'

Shell to use for command execution. Defaults to "/bin/bash".

View source on GitHub