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
  • Jestlike
  • Vercel
  • Anthropic
  • Sandbox
⌘I

LangChain Assistant

Ask a question to get started

Enter to send•Shift+Enter new line

Menu

LangSmith
ClientRun TreesTraceableEvaluationSchemasLangchainJestVitestWrappersAnonymizerJestlikeVercelAnthropicSandbox
Language
Theme
JavaScriptlangsmithsandboxSandboxreadRange
Method●Since v0.13

readRange

Read part of a file, for chunked reads and resumed downloads.

Copy
readRange(path: string, options: ReadRangeOptions): Promise<FileChunk>

Parameters

NameTypeDescription
path*string

File path to read.

options*ReadRangeOptions

The byte range, plus optional ifRange/ifNoneMatch validators. A 200 answer to a ranged request means the file changed and the server sent it whole -- restart rather than append.

Example

Copy
const head = await sandbox.readRange("/big.bin", { start: 0, end: 1023 });
const next = await sandbox.readRange("/big.bin", {
  start: head.end ?? 1024,
  ifRange: head.etag,
});
View source on GitHub