Skip to content

Commit 5600bd6

Browse files
feat(api): api update
1 parent ffc0ce9 commit 5600bd6

4 files changed

Lines changed: 15 additions & 6 deletions

File tree

.stats.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 79
22
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-589e342137de29187fec9e332ae5ca29de64e531f8b92b46b2469fdb3449a721.yml
33
openapi_spec_hash: 5dbf4fe59153afb4d4c8642e05fcecdc
4-
config_hash: 38219157b7a6dd4d0accbd0d57095420
4+
config_hash: 7cef6c9fce4f9a345184516c6cde462f

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -250,15 +250,15 @@ client.with_options(max_retries=5).devboxes.create()
250250

251251
### Timeouts
252252

253-
By default requests time out after 10 minutes. You can configure this with a `timeout` option,
253+
By default requests time out after 1 minute. You can configure this with a `timeout` option,
254254
which accepts a float or an [`httpx.Timeout`](https://www.python-httpx.org/advanced/#fine-tuning-the-configuration) object:
255255

256256
```python
257257
from runloop_api_client import Runloop
258258

259259
# Configure the default for all requests:
260260
client = Runloop(
261-
# 20 seconds (default is 10 minutes)
261+
# 20 seconds (default is 1 minute)
262262
timeout=20.0,
263263
)
264264

src/runloop_api_client/_constants.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
RAW_RESPONSE_HEADER = "X-Stainless-Raw-Response"
66
OVERRIDE_CAST_TO_HEADER = "____stainless_override_cast_to"
77

8-
# default timeout is 10 minutes
9-
DEFAULT_TIMEOUT = httpx.Timeout(timeout=600, connect=5.0)
8+
# default timeout is 1 minute
9+
DEFAULT_TIMEOUT = httpx.Timeout(timeout=60, connect=5.0)
1010
DEFAULT_MAX_RETRIES = 0
1111
DEFAULT_CONNECTION_LIMITS = httpx.Limits(max_connections=100, max_keepalive_connections=20)
1212

src/runloop_api_client/resources/devboxes/devboxes.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
devbox_write_file_contents_params,
4040
)
4141
from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven, FileTypes
42-
from ..._utils import extract_files, maybe_transform, deepcopy_minimal, async_maybe_transform
42+
from ..._utils import is_given, extract_files, maybe_transform, deepcopy_minimal, async_maybe_transform
4343
from .browsers import (
4444
BrowsersResource,
4545
AsyncBrowsersResource,
@@ -80,6 +80,7 @@
8080
async_to_custom_raw_response_wrapper,
8181
async_to_custom_streamed_response_wrapper,
8282
)
83+
from ..._constants import DEFAULT_TIMEOUT
8384
from ...pagination import (
8485
SyncDevboxesCursorIDPage,
8586
AsyncDevboxesCursorIDPage,
@@ -791,6 +792,8 @@ def execute_sync(
791792
"""
792793
if not id:
793794
raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
795+
if not is_given(timeout) and self._client.timeout == DEFAULT_TIMEOUT:
796+
timeout = 600
794797
return self._post(
795798
f"/v1/devboxes/{id}/execute_sync",
796799
body=maybe_transform(
@@ -1128,6 +1131,8 @@ def snapshot_disk(
11281131
"""
11291132
if not id:
11301133
raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
1134+
if not is_given(timeout) and self._client.timeout == DEFAULT_TIMEOUT:
1135+
timeout = 600
11311136
return self._post(
11321137
f"/v1/devboxes/{id}/snapshot_disk",
11331138
body=maybe_transform(
@@ -1984,6 +1989,8 @@ async def execute_sync(
19841989
"""
19851990
if not id:
19861991
raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
1992+
if not is_given(timeout) and self._client.timeout == DEFAULT_TIMEOUT:
1993+
timeout = 600
19871994
return await self._post(
19881995
f"/v1/devboxes/{id}/execute_sync",
19891996
body=await async_maybe_transform(
@@ -2321,6 +2328,8 @@ async def snapshot_disk(
23212328
"""
23222329
if not id:
23232330
raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
2331+
if not is_given(timeout) and self._client.timeout == DEFAULT_TIMEOUT:
2332+
timeout = 600
23242333
return await self._post(
23252334
f"/v1/devboxes/{id}/snapshot_disk",
23262335
body=await async_maybe_transform(

0 commit comments

Comments
 (0)