Skip to content

Commit 8269369

Browse files
committed
bash timeout
2 parents 9b8672c + 14f8c3a commit 8269369

File tree

7 files changed

+49
-24
lines changed

7 files changed

+49
-24
lines changed

poetry.lock

Lines changed: 24 additions & 21 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name = "scrapybara"
33

44
[tool.poetry]
55
name = "scrapybara"
6-
version = "2.6.0-beta.0"
6+
version = "2.6.0-beta.1"
77
description = ""
88
readme = "README.md"
99
authors = []

reference.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -562,6 +562,14 @@ client.instance.bash(
562562
<dl>
563563
<dd>
564564

565+
**timeout:** `typing.Optional[float]`
566+
567+
</dd>
568+
</dl>
569+
570+
<dl>
571+
<dd>
572+
565573
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
566574

567575
</dd>

src/scrapybara/client.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -922,6 +922,7 @@ def bash(
922922
restart: Optional[bool] = OMIT,
923923
list_sessions: Optional[bool] = OMIT,
924924
check_session: Optional[int] = OMIT,
925+
timeout: Optional[float] = None,
925926
request_options: Optional[RequestOptions] = None,
926927
) -> Optional[Any]:
927928
return self._client.instance.bash(
@@ -931,6 +932,7 @@ def bash(
931932
restart=restart,
932933
list_sessions=list_sessions,
933934
check_session=check_session,
935+
timeout=timeout,
934936
request_options=request_options
935937
)
936938

@@ -1458,6 +1460,7 @@ async def bash(
14581460
restart: Optional[bool] = OMIT,
14591461
list_sessions: Optional[bool] = OMIT,
14601462
check_session: Optional[int] = OMIT,
1463+
timeout: Optional[float] = None,
14611464
request_options: Optional[RequestOptions] = None,
14621465
) -> Optional[Any]:
14631466
return await self._client.instance.bash(
@@ -1467,6 +1470,7 @@ async def bash(
14671470
restart=restart,
14681471
list_sessions=list_sessions,
14691472
check_session=check_session,
1473+
timeout=timeout,
14701474
request_options=request_options
14711475
)
14721476

src/scrapybara/core/client_wrapper.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ def get_headers(self) -> typing.Dict[str, str]:
1616
headers: typing.Dict[str, str] = {
1717
"X-Fern-Language": "Python",
1818
"X-Fern-SDK-Name": "scrapybara",
19-
"X-Fern-SDK-Version": "2.6.0-beta.0",
19+
"X-Fern-SDK-Version": "2.6.0-beta.1",
2020
}
2121
headers["x-api-key"] = self.api_key
2222
return headers

src/scrapybara/instance/client.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,7 @@ def bash(
219219
restart: typing.Optional[bool] = OMIT,
220220
list_sessions: typing.Optional[bool] = OMIT,
221221
check_session: typing.Optional[int] = OMIT,
222+
timeout: typing.Optional[float] = OMIT,
222223
request_options: typing.Optional[RequestOptions] = None,
223224
) -> BashResponse:
224225
"""
@@ -236,6 +237,8 @@ def bash(
236237
237238
check_session : typing.Optional[int]
238239
240+
timeout : typing.Optional[float]
241+
239242
request_options : typing.Optional[RequestOptions]
240243
Request-specific configuration.
241244
@@ -264,6 +267,7 @@ def bash(
264267
"restart": restart,
265268
"list_sessions": list_sessions,
266269
"check_session": check_session,
270+
"timeout": timeout,
267271
},
268272
headers={
269273
"content-type": "application/json",
@@ -1131,6 +1135,7 @@ async def bash(
11311135
restart: typing.Optional[bool] = OMIT,
11321136
list_sessions: typing.Optional[bool] = OMIT,
11331137
check_session: typing.Optional[int] = OMIT,
1138+
timeout: typing.Optional[float] = OMIT,
11341139
request_options: typing.Optional[RequestOptions] = None,
11351140
) -> BashResponse:
11361141
"""
@@ -1148,6 +1153,8 @@ async def bash(
11481153
11491154
check_session : typing.Optional[int]
11501155
1156+
timeout : typing.Optional[float]
1157+
11511158
request_options : typing.Optional[RequestOptions]
11521159
Request-specific configuration.
11531160
@@ -1184,6 +1191,7 @@ async def main() -> None:
11841191
"restart": restart,
11851192
"list_sessions": list_sessions,
11861193
"check_session": check_session,
1194+
"timeout": timeout,
11871195
},
11881196
headers={
11891197
"content-type": "application/json",

src/scrapybara/tools/__init__.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,7 @@ class BashToolParameters(BaseModel):
169169
restart: Optional[bool] = Field(False, description="Whether to restart the shell")
170170
list_sessions: Optional[bool] = Field(None, description="Whether to list all bash sessions")
171171
check_session: Optional[int] = Field(None, description="Session ID to check status")
172+
timeout: Optional[float] = Field(None, description="Timeout for the command")
172173

173174

174175
class BashTool(Tool):
@@ -193,6 +194,7 @@ def __call__(self, **kwargs: Any) -> Any:
193194
session=params.session,
194195
restart=params.restart,
195196
list_sessions=params.list_sessions,
196-
check_session=params.check_session
197+
check_session=params.check_session,
198+
timeout=params.timeout,
197199
)
198200

0 commit comments

Comments
 (0)