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

read

Read a file from the sandbox.

Copy
read(path: string, timeout: number = 60): Promise<Uint8Array<ArrayBufferLike>>

Parameters

NameTypeDescription
path*string

File path to read. Supports both absolute paths (e.g., /tmp/file.txt) and relative paths (resolved from /home/user/).

timeoutnumber
Default:60

Request timeout in seconds.

Example

Copy
const content = await sandbox.read("/tmp/output.txt");
const text = new TextDecoder().decode(content);
console.log(text);
View source on GitHub