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
JavaScriptlangsmithsandboxSandboxClientgenerateDownloadURL
Method●Since v0.11

generateDownloadURL

Create a link that downloads one file from a sandbox.

The link carries its own token, so anyone holding the URL can fetch that one file without a LangSmith credential. It is pinned to the sandbox and the exact path and cannot be repointed at another file. 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.

Copy
generateDownloadURL(
  name: string,
  path: string,
  options: GenerateDownloadURLOptions = {}
): Promise<DownloadURL>

Parameters

NameTypeDescription
name*string

Sandbox name.

path*string

File path inside the sandbox.

optionsGenerateDownloadURLOptions
Default:{}

Expiry and response header overrides.

Example

Copy
const link = await client.generateDownloadURL("my-vm", "/tmp/report.pdf");
console.log(link.download_url);
View source on GitHub