smooth-py 0.2.5.post0__tar.gz → 0.2.6__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of smooth-py might be problematic. Click here for more details.
- {smooth_py-0.2.5.post0 → smooth_py-0.2.6}/PKG-INFO +1 -1
- {smooth_py-0.2.5.post0 → smooth_py-0.2.6}/pyproject.toml +1 -1
- {smooth_py-0.2.5.post0 → smooth_py-0.2.6}/src/smooth/__init__.py +20 -15
- {smooth_py-0.2.5.post0 → smooth_py-0.2.6}/README.md +0 -0
- {smooth_py-0.2.5.post0 → smooth_py-0.2.6}/src/smooth/mcp/__init__.py +0 -0
- {smooth_py-0.2.5.post0 → smooth_py-0.2.6}/src/smooth/mcp/server.py +0 -0
|
@@ -60,12 +60,16 @@ class TaskRequest(BaseModel):
|
|
|
60
60
|
metadata: dict[str, str | int | float | bool] | None = Field(
|
|
61
61
|
default=None, description="A dictionary containing variables or parameters that will be passed to the agent."
|
|
62
62
|
)
|
|
63
|
-
files: list[str] | None = Field(
|
|
64
|
-
default=None, description="A list of file ids to pass to the agent."
|
|
65
|
-
)
|
|
63
|
+
files: list[str] | None = Field(default=None, description="A list of file ids to pass to the agent.")
|
|
66
64
|
agent: Literal["smooth"] = Field(default="smooth", description="The agent to use for the task.")
|
|
67
65
|
max_steps: int = Field(default=32, ge=2, le=128, description="Maximum number of steps the agent can take (min 2, max 128).")
|
|
68
66
|
device: Literal["desktop", "mobile"] = Field(default="mobile", description="Device type for the task. Default is mobile.")
|
|
67
|
+
allowed_urls: list[str] | None = Field(
|
|
68
|
+
default=None,
|
|
69
|
+
description=(
|
|
70
|
+
"List of allowed URL patterns using wildcard syntax (e.g., https://*example.com/*). If None, all URLs are allowed."
|
|
71
|
+
),
|
|
72
|
+
)
|
|
69
73
|
enable_recording: bool = Field(default=True, description="Enable video recording of the task execution. Default is True")
|
|
70
74
|
session_id: str | None = Field(
|
|
71
75
|
default=None,
|
|
@@ -107,6 +111,7 @@ class BrowserSessionsResponse(BaseModel):
|
|
|
107
111
|
|
|
108
112
|
class UploadFileResponse(BaseModel):
|
|
109
113
|
"""Response model for uploading a file."""
|
|
114
|
+
|
|
110
115
|
id: str = Field(description="The ID assigned to the uploaded file.")
|
|
111
116
|
|
|
112
117
|
|
|
@@ -313,6 +318,7 @@ class SmoothClient(BaseClient):
|
|
|
313
318
|
agent: Literal["smooth"] = "smooth",
|
|
314
319
|
max_steps: int = 32,
|
|
315
320
|
device: Literal["desktop", "mobile"] = "mobile",
|
|
321
|
+
allowed_urls: list[str] | None = None,
|
|
316
322
|
enable_recording: bool = False,
|
|
317
323
|
session_id: str | None = None,
|
|
318
324
|
stealth_mode: bool = False,
|
|
@@ -334,6 +340,8 @@ class SmoothClient(BaseClient):
|
|
|
334
340
|
agent: The agent to use for the task.
|
|
335
341
|
max_steps: Maximum number of steps the agent can take (max 64).
|
|
336
342
|
device: Device type for the task. Default is mobile.
|
|
343
|
+
allowed_urls: List of allowed URL patterns using wildcard syntax (e.g., https://*example.com/*).
|
|
344
|
+
If None, all URLs are allowed.
|
|
337
345
|
enable_recording: Enable video recording of the task execution.
|
|
338
346
|
session_id: Browser session ID to use.
|
|
339
347
|
stealth_mode: Run the browser in stealth mode.
|
|
@@ -356,6 +364,7 @@ class SmoothClient(BaseClient):
|
|
|
356
364
|
agent=agent,
|
|
357
365
|
max_steps=max_steps,
|
|
358
366
|
device=device,
|
|
367
|
+
allowed_urls=allowed_urls,
|
|
359
368
|
enable_recording=enable_recording,
|
|
360
369
|
session_id=session_id,
|
|
361
370
|
stealth_mode=stealth_mode,
|
|
@@ -438,15 +447,11 @@ class SmoothClient(BaseClient):
|
|
|
438
447
|
raise ValueError("File name must be provided or the file object must have a 'name' attribute.")
|
|
439
448
|
|
|
440
449
|
if purpose:
|
|
441
|
-
data = {
|
|
442
|
-
"file_purpose": purpose
|
|
443
|
-
}
|
|
450
|
+
data = {"file_purpose": purpose}
|
|
444
451
|
else:
|
|
445
452
|
data = None
|
|
446
453
|
|
|
447
|
-
files = {
|
|
448
|
-
"file": (Path(name).name, file)
|
|
449
|
-
}
|
|
454
|
+
files = {"file": (Path(name).name, file)}
|
|
450
455
|
response = self._session.post(f"{self.base_url}/file", files=files, data=data)
|
|
451
456
|
data = self._handle_response(response)
|
|
452
457
|
return UploadFileResponse(**data["r"])
|
|
@@ -580,6 +585,7 @@ class SmoothAsyncClient(BaseClient):
|
|
|
580
585
|
agent: Literal["smooth"] = "smooth",
|
|
581
586
|
max_steps: int = 32,
|
|
582
587
|
device: Literal["desktop", "mobile"] = "mobile",
|
|
588
|
+
allowed_urls: list[str] | None = None,
|
|
583
589
|
enable_recording: bool = False,
|
|
584
590
|
session_id: str | None = None,
|
|
585
591
|
stealth_mode: bool = False,
|
|
@@ -601,6 +607,8 @@ class SmoothAsyncClient(BaseClient):
|
|
|
601
607
|
agent: The agent to use for the task.
|
|
602
608
|
max_steps: Maximum number of steps the agent can take (max 64).
|
|
603
609
|
device: Device type for the task. Default is mobile.
|
|
610
|
+
allowed_urls: List of allowed URL patterns using wildcard syntax (e.g., https://*example.com/*).
|
|
611
|
+
If None, all URLs are allowed.
|
|
604
612
|
enable_recording: Enable video recording of the task execution.
|
|
605
613
|
session_id: Browser session ID to use.
|
|
606
614
|
stealth_mode: Run the browser in stealth mode.
|
|
@@ -625,6 +633,7 @@ class SmoothAsyncClient(BaseClient):
|
|
|
625
633
|
agent=agent,
|
|
626
634
|
max_steps=max_steps,
|
|
627
635
|
device=device,
|
|
636
|
+
allowed_urls=allowed_urls,
|
|
628
637
|
enable_recording=enable_recording,
|
|
629
638
|
session_id=session_id,
|
|
630
639
|
stealth_mode=stealth_mode,
|
|
@@ -706,13 +715,9 @@ class SmoothAsyncClient(BaseClient):
|
|
|
706
715
|
if name is None:
|
|
707
716
|
raise ValueError("File name must be provided or the file object must have a 'name' attribute.")
|
|
708
717
|
|
|
709
|
-
files = {
|
|
710
|
-
"file": (Path(name).name, file)
|
|
711
|
-
}
|
|
718
|
+
files = {"file": (Path(name).name, file)}
|
|
712
719
|
if purpose:
|
|
713
|
-
data = {
|
|
714
|
-
"file_purpose": purpose
|
|
715
|
-
}
|
|
720
|
+
data = {"file_purpose": purpose}
|
|
716
721
|
else:
|
|
717
722
|
data = None
|
|
718
723
|
response = await self._client.post(f"{self.base_url}/file", files=files, data=data)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|