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_sandboxSandboxgenerate_download_url
Methodā—Since v0.11

generate_download_url

Copy
generate_download_url(
  self,
  path: str,
  *,
  expires_in_seconds: Optional[int] = 
View source on GitHub
None
,
content_type
:
Optional
[
str
]
=
None
,
content_disposition
:
Optional
[
DownloadContentDisposition
]
=
None
,
headers
:
RequestHeaders
=
None
)
->
DownloadURL

Parameters

NameTypeDescription
path*str

File path inside the sandbox.

expires_in_secondsOptional[int]
Default:None

Link TTL in seconds. Omit for a link that never expires.

content_typeOptional[str]
Default:None
content_dispositionOptional[DownloadContentDisposition]
Default:None
headersRequestHeaders
Default:None

Create a link that downloads one file from this sandbox.

The link carries its own token, so anyone holding the URL can fetch that one file without a LangSmith credential. Fetching wakes a stopped sandbox.

Do not modify the file after minting a link for it. The link is pinned to a path, not to a snapshot of the contents, so a later write to that path may or may not be reflected in what the link serves. Write a new file and mint a new link when the contents change.

Content-Type to serve the file as.

Content-Disposition to serve the file with, either "attachment" or "inline".

Optional per-request header overrides.