Skip to content

Commit 4cd8756

Browse files
committed
js accept type of volume in sandbox create opts
1 parent 4fea3d7 commit 4cd8756

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

packages/js-sdk/src/sandbox/sandboxApi.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import {
77
import { compareVersions } from 'compare-versions'
88
import { NotFoundError, TemplateError } from '../errors'
99
import { timeoutToSeconds } from '../utils'
10+
import type { Volume } from '../volume'
1011
import type { McpServer as BaseMcpServer } from './mcp'
1112

1213
/**
@@ -133,12 +134,11 @@ export interface SandboxOpts extends ConnectionOpts {
133134
* Volume mounts for the sandbox.
134135
*
135136
* The keys are mount paths inside the sandbox and the values are either
136-
* a Volume instance (or any object with `volumeId` and `name`) or a string
137-
* representing the volume name.
137+
* a `Volume` instance or a string representing the volume name.
138138
*
139139
* @default undefined
140140
*/
141-
volumeMounts?: Record<string, { name: string } | string>
141+
volumeMounts?: Record<string, Volume | string>
142142

143143
/**
144144
* Sandbox URL. Used for local development

packages/python-sdk/e2b/volume/volume_async.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -438,6 +438,7 @@ async def read_file(
438438
timeout = config.get_request_timeout(opts.get("request_timeout"))
439439

440440
if format == "stream":
441+
441442
async def stream_file() -> AsyncIterator[bytes]:
442443
async with api_client.get_async_httpx_client().stream(
443444
method="GET",

packages/python-sdk/e2b/volume/volume_sync.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -436,6 +436,7 @@ def read_file(
436436
timeout = config.get_request_timeout(opts.get("request_timeout"))
437437

438438
if format == "stream":
439+
439440
def stream_file() -> Iterator[bytes]:
440441
with api_client.get_httpx_client().stream(
441442
method="GET",

0 commit comments

Comments
 (0)