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
⌘I

LangChain Assistant

Ask a question to get started

Enter to send•Shift+Enter new line

Menu

OverviewClientAsyncClientRun HelpersRun TreesEvaluationSchemasUtilitiesWrappersAnonymizerTestingExpect APIMiddlewarePytest PluginDeployment SDK
Language
Theme
Pythonlangsmithsandbox_async_sandboxAsyncSandboxread_range
Method●Since v0.13

read_range

Copy
read_range(
  self,
  path: str,
  *,
  start: Optional[int] = 
View source on GitHub
None
,
end
:
Optional
[
int
]
=
None
,
suffix_bytes
:
Optional
[
int
]
=
None
,
if_range
:
Optional
[
str
]
=
None
,
if_none_match
:
Optional
[
str
]
=
None
,
timeout
:
int
=
60
,
headers
:
RequestHeaders
=
None
)
->
FileChunk

Parameters

NameTypeDescription
path*str

File path to read.

startOptional[int]
Default:None

First byte to return. With end, an inclusive range.

endOptional[int]
Default:None
suffix_bytesOptional[int]
Default:None
if_rangeOptional[str]
Default:None
if_none_matchOptional[str]
Default:None
timeoutint
Default:60
headersRequestHeaders
Default:None

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

Last byte to return, inclusive. Clamped to EOF rather than rejected.

Return the last N bytes. Mutually exclusive with start/end.

An ETag from an earlier chunk. The range is honored only while the file still matches it; a rewrite answers 200 with the whole file, reported as partial=False so a resuming caller restarts instead of splicing two versions.

An ETag the caller already holds. An unchanged file answers with unchanged=True and no bytes.

Request timeout in seconds.

Extra request headers.