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

capture_snapshot

Copy
capture_snapshot(
  self,
  sandbox_name: str,
  name: str,
  *,
  tag: Optional
View source on GitHub
[
str
]
=
None
,
docker_image
:
Optional
[
str
]
=
None
,
fs_capacity_bytes
:
Optional
[
int
]
=
None
,
run_config
:
Optional
[
Union
[
RunConfig
,
dict
[
str
,
Any
]
]
]
=
None
,
timeout
:
int
=
60
,
headers
:
RequestHeaders
=
None
)
->
Snapshot

Parameters

NameTypeDescription
sandbox_name*str

Name of the sandbox to capture from.

name*str

Snapshot name.

tagOptional[str]
Default:None

Tag to publish the snapshot under, within name. Re-using a tag moves it to the new snapshot, leaving the previous one addressable by id. Defaults server-side to latest.

docker_imageOptional[str]
Default:None
fs_capacity_bytesOptional[int]
Default:None
run_configOptional[Union[RunConfig, dict[str, Any]]]
Default:None
timeoutint
Default:60

Capture a snapshot from a running sandbox.

Blocks until the snapshot is ready (polls with 2s interval).

Optional Docker image tag inside the sandbox to export into the snapshot instead of capturing the live root filesystem.

Filesystem capacity in bytes for Docker image export.

Override applied over the configuration the captured sandbox was running with: user and work_dir replace, env_vars merge. The captured sandbox's own env_vars are a per-sandbox layer and are not carried into the snapshot.

Timeout in seconds when waiting for ready.