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_sandboxSandboxwrite
Method●Since v0.6

write

Write content to a file in the sandbox.

Copy
write(
  self,
  path: str,
  content: Union[str, bytes],
  *,
  timeout: int = 60
) -> None

Parameters

NameTypeDescription
path*str

Target file path in the sandbox.

content*Union[str, bytes]

File content (str or bytes).

timeoutint
Default:60

Request timeout in seconds.

View source on GitHub