smooth-py 0.2.0__py3-none-any.whl → 0.2.1.dev20250911__py3-none-any.whl
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/__init__.py
CHANGED
|
@@ -49,8 +49,13 @@ class TaskRequest(BaseModel):
|
|
|
49
49
|
|
|
50
50
|
task: str = Field(description="The task to run.")
|
|
51
51
|
response_model: dict[str, Any] | None = Field(
|
|
52
|
-
default=None, description="If provided, the schema describing the desired output structure. Default is None"
|
|
52
|
+
default=None, description="If provided, the JSON schema describing the desired output structure. Default is None"
|
|
53
53
|
)
|
|
54
|
+
url: str | None = Field(
|
|
55
|
+
default=None,
|
|
56
|
+
description="(Optional) The starting URL for the task. If not provided, the agent will infer it from the task.",
|
|
57
|
+
)
|
|
58
|
+
metadata: dict[str, str | int | float | bool] | None = Field(default=None, description="Optional metadata for the task.")
|
|
54
59
|
agent: Literal["smooth"] = Field(default="smooth", description="The agent to use for the task.")
|
|
55
60
|
max_steps: int = Field(default=32, ge=2, le=128, description="Maximum number of steps the agent can take (min 2, max 128).")
|
|
56
61
|
device: Literal["desktop", "mobile"] = Field(default="mobile", description="Device type for the task. Default is mobile.")
|
|
@@ -136,7 +141,7 @@ class BaseClient:
|
|
|
136
141
|
self.headers = {
|
|
137
142
|
"apikey": self.api_key,
|
|
138
143
|
"Content-Type": "application/json",
|
|
139
|
-
"User-Agent": "smooth-python-sdk/0.
|
|
144
|
+
"User-Agent": "smooth-python-sdk/0.2.0",
|
|
140
145
|
}
|
|
141
146
|
|
|
142
147
|
def _handle_response(self, response: requests.Response | httpx.Response) -> dict[str, Any]:
|
|
@@ -187,7 +192,11 @@ class TaskHandle:
|
|
|
187
192
|
self._client = client
|
|
188
193
|
self._task_response: TaskResponse | None = None
|
|
189
194
|
|
|
190
|
-
self.
|
|
195
|
+
self._id = task_id
|
|
196
|
+
|
|
197
|
+
def id(self):
|
|
198
|
+
"""Returns the task ID."""
|
|
199
|
+
return self._id
|
|
191
200
|
|
|
192
201
|
def result(self, timeout: int | None = None, poll_interval: float = 1) -> TaskResponse:
|
|
193
202
|
"""Waits for the task to complete and returns the result."""
|
|
@@ -287,6 +296,8 @@ class SmoothClient(BaseClient):
|
|
|
287
296
|
self,
|
|
288
297
|
task: str,
|
|
289
298
|
response_model: dict[str, Any] | Type[BaseModel] | None = None,
|
|
299
|
+
url: str | None = None,
|
|
300
|
+
metadata: dict[str, str | int | float | bool] | None = None,
|
|
290
301
|
agent: Literal["smooth"] = "smooth",
|
|
291
302
|
max_steps: int = 32,
|
|
292
303
|
device: Literal["desktop", "mobile"] = "mobile",
|
|
@@ -305,6 +316,8 @@ class SmoothClient(BaseClient):
|
|
|
305
316
|
Args:
|
|
306
317
|
task: The task to run.
|
|
307
318
|
response_model: If provided, the schema describing the desired output structure.
|
|
319
|
+
url: The starting URL for the task. If not provided, the agent will infer it from the task.
|
|
320
|
+
metadata: Optional metadata for the task.
|
|
308
321
|
agent: The agent to use for the task.
|
|
309
322
|
max_steps: Maximum number of steps the agent can take (max 64).
|
|
310
323
|
device: Device type for the task. Default is mobile.
|
|
@@ -324,6 +337,8 @@ class SmoothClient(BaseClient):
|
|
|
324
337
|
payload = TaskRequest(
|
|
325
338
|
task=task,
|
|
326
339
|
response_model=response_model.model_json_schema() if issubclass(response_model, BaseModel) else response_model,
|
|
340
|
+
url=url,
|
|
341
|
+
metadata=metadata,
|
|
327
342
|
agent=agent,
|
|
328
343
|
max_steps=max_steps,
|
|
329
344
|
device=device,
|
|
@@ -495,6 +510,8 @@ class SmoothAsyncClient(BaseClient):
|
|
|
495
510
|
self,
|
|
496
511
|
task: str,
|
|
497
512
|
response_model: dict[str, Any] | Type[BaseModel] | None = None,
|
|
513
|
+
url: str | None = None,
|
|
514
|
+
metadata: dict[str, str | int | float | bool] | None = None,
|
|
498
515
|
agent: Literal["smooth"] = "smooth",
|
|
499
516
|
max_steps: int = 32,
|
|
500
517
|
device: Literal["desktop", "mobile"] = "mobile",
|
|
@@ -513,6 +530,8 @@ class SmoothAsyncClient(BaseClient):
|
|
|
513
530
|
Args:
|
|
514
531
|
task: The task to run.
|
|
515
532
|
response_model: If provided, the schema describing the desired output structure.
|
|
533
|
+
url: The starting URL for the task. If not provided, the agent will infer it from the task.
|
|
534
|
+
metadata: Optional metadata for the task.
|
|
516
535
|
agent: The agent to use for the task.
|
|
517
536
|
max_steps: Maximum number of steps the agent can take (max 64).
|
|
518
537
|
device: Device type for the task. Default is mobile.
|
|
@@ -534,6 +553,8 @@ class SmoothAsyncClient(BaseClient):
|
|
|
534
553
|
payload = TaskRequest(
|
|
535
554
|
task=task,
|
|
536
555
|
response_model=response_model.model_json_schema() if issubclass(response_model, BaseModel) else response_model,
|
|
556
|
+
url=url,
|
|
557
|
+
metadata=metadata,
|
|
537
558
|
agent=agent,
|
|
538
559
|
max_steps=max_steps,
|
|
539
560
|
device=device,
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
smooth/__init__.py,sha256=L-qnxbgkS40esgcEo9-laRGAzsCoK8W6-5EyS0lFRDU,24559
|
|
2
|
+
smooth/mcp/__init__.py,sha256=0aJVFi2a8Ah3-5xtgyZ5UMbaaJsBWu2T8QLWoFQITk8,219
|
|
3
|
+
smooth/mcp/server.py,sha256=9SymTD4NOGTMN8P-LNGlvYNvv81yCIZfZeeuhEcAc6s,20068
|
|
4
|
+
smooth_py-0.2.1.dev20250911.dist-info/METADATA,sha256=ApjDoqXRckaSUQPYrpfNzJcp17QZ5dbzCnkPsNqwfHY,7437
|
|
5
|
+
smooth_py-0.2.1.dev20250911.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
|
|
6
|
+
smooth_py-0.2.1.dev20250911.dist-info/RECORD,,
|
smooth_py-0.2.0.dist-info/RECORD
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
smooth/__init__.py,sha256=U32quTlDKOWQpsstfJ7pCgsOeUWYC3AAAzQDJkpBzBk,23629
|
|
2
|
-
smooth/mcp/__init__.py,sha256=0aJVFi2a8Ah3-5xtgyZ5UMbaaJsBWu2T8QLWoFQITk8,219
|
|
3
|
-
smooth/mcp/server.py,sha256=9SymTD4NOGTMN8P-LNGlvYNvv81yCIZfZeeuhEcAc6s,20068
|
|
4
|
-
smooth_py-0.2.0.dist-info/METADATA,sha256=o9iLsqHyEBGkOyPmW695HHmcQwV0afH2Evkp7a0O6KA,7425
|
|
5
|
-
smooth_py-0.2.0.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
|
|
6
|
-
smooth_py-0.2.0.dist-info/RECORD,,
|
|
File without changes
|