LangChain Reference home pageLangChain ReferenceLangChain Reference
  • GitHub
  • Main Docs
Deep Agents
LangChain
LangGraph
Integrations
LangSmith
LangSmith
  • Client
  • Run Trees
  • Traceable
  • Evaluation
  • Schemas
  • Langchain
  • Jest
  • Vitest
  • Wrappers
  • Anonymizer
  • Traceable
  • Jestlike
  • Vercel
  • Anthropic
  • Sandbox
⌘I

LangChain Assistant

Ask a question to get started

Enter to send•Shift+Enter new line

Menu

LangSmith
ClientRun TreesTraceableEvaluationSchemasLangchainJestVitestWrappersAnonymizerTraceableJestlikeVercelAnthropicSandbox
Language
Theme
JavaScriptlangsmithexperimentalsandboxSandboxwrite
Method●Since v0.6

write

Write content to a file in the sandbox.

Copy
write(
  path: string,
  content: string | Uint8Array<ArrayBufferLike>,
  timeout: number = 60
): Promise<void>

Parameters

NameTypeDescription
path*string

Target file path in the sandbox.

content*string | Uint8Array<ArrayBufferLike>

File content (string or bytes).

timeoutnumber
Default:60

Request timeout in seconds.

Example

Copy
await sandbox.write("/tmp/script.py", 'print("Hello!")');
View source on GitHub