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.
generateDownloadURL(path: string, options: GenerateDownloadURLOptions = {}): Promise<DownloadURL>| Name | Type | Description |
|---|---|---|
path* | string | File path inside the sandbox. |
options | GenerateDownloadURLOptions | Default: {}Expiry and response header overrides. |
const link = await sandbox.generateDownloadURL("/tmp/report.pdf", {
expiresInSeconds: 3600,
});
console.log(link.download_url);