smooth-py 0.2.0__tar.gz → 0.2.1.dev20250911__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.

@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: smooth-py
3
- Version: 0.2.0
3
+ Version: 0.2.1.dev20250911
4
4
  Summary:
5
5
  Author: Luca Pinchetti
6
6
  Author-email: luca@circlemind.co
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "smooth-py"
3
- version = "0.2.0"
3
+ version = "0.2.1.dev20250911"
4
4
  description = ""
5
5
  authors = [
6
6
  {name = "Luca Pinchetti",email = "luca@circlemind.co"}
@@ -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.1.1",
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.id = task_id
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,