smooth-py 0.2.8.dev20251006__tar.gz → 0.2.8.dev20251008__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.8.dev20251006
3
+ Version: 0.2.8.dev20251008
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.8.dev20251006"
3
+ version = "0.2.8.dev20251008"
4
4
  description = ""
5
5
  authors = [
6
6
  {name = "Luca Pinchetti",email = "luca@circlemind.co"}
@@ -53,6 +53,8 @@ class TaskResponse(BaseModel):
53
53
  class TaskRequest(BaseModel):
54
54
  """Run task request model."""
55
55
 
56
+ model_config = ConfigDict(extra="allow")
57
+
56
58
  task: str = Field(description="The task to run.")
57
59
  response_model: dict[str, Any] | None = Field(
58
60
  default=None, description="If provided, the JSON schema describing the desired output structure. Default is None"
@@ -65,7 +67,7 @@ class TaskRequest(BaseModel):
65
67
  default=None, description="A dictionary containing variables or parameters that will be passed to the agent."
66
68
  )
67
69
  files: list[str] | None = Field(default=None, description="A list of file ids to pass to the agent.")
68
- agent: Literal["smooth"] = Field(default="smooth", description="The agent to use for the task.")
70
+ agent: Literal["smooth", "smooth-lite"] = Field(default="smooth", description="The agent to use for the task.")
69
71
  max_steps: int = Field(default=32, ge=2, le=128, description="Maximum number of steps the agent can take (min 2, max 128).")
70
72
  device: Literal["desktop", "mobile"] = Field(default="mobile", description="Device type for the task. Default is mobile.")
71
73
  allowed_urls: list[str] | None = Field(
@@ -115,6 +117,14 @@ class TaskRequest(BaseModel):
115
117
  warnings.warn("'session_id' is deprecated, use 'profile_id' instead", DeprecationWarning, stacklevel=2)
116
118
  self.profile_id = value
117
119
 
120
+ def model_dump(self, **kwargs) -> dict[str, Any]:
121
+ """Dump model to dict, including deprecated session_id for retrocompatibility."""
122
+ data = super().model_dump(**kwargs)
123
+ # Add deprecated session_id field for retrocompatibility
124
+ if "profile_id" in data:
125
+ data["session_id"] = data["profile_id"]
126
+ return data
127
+
118
128
 
119
129
  class BrowserSessionRequest(BaseModel):
120
130
  """Request model for creating a browser session."""
@@ -144,6 +154,14 @@ class BrowserSessionRequest(BaseModel):
144
154
  warnings.warn("'session_id' is deprecated, use 'profile_id' instead", DeprecationWarning, stacklevel=2)
145
155
  self.profile_id = value
146
156
 
157
+ def model_dump(self, **kwargs) -> dict[str, Any]:
158
+ """Dump model to dict, including deprecated session_id for retrocompatibility."""
159
+ data = super().model_dump(**kwargs)
160
+ # Add deprecated session_id field for retrocompatibility
161
+ if "profile_id" in data:
162
+ data["session_id"] = data["profile_id"]
163
+ return data
164
+
147
165
 
148
166
  class BrowserSessionResponse(BaseModel):
149
167
  """Browser session response model."""
@@ -172,6 +190,14 @@ class BrowserSessionResponse(BaseModel):
172
190
  warnings.warn("'session_id' is deprecated, use 'profile_id' instead", DeprecationWarning, stacklevel=2)
173
191
  self.profile_id = value
174
192
 
193
+ def model_dump(self, **kwargs) -> dict[str, Any]:
194
+ """Dump model to dict, including deprecated session_id for retrocompatibility."""
195
+ data = super().model_dump(**kwargs)
196
+ # Add deprecated session_id field for retrocompatibility
197
+ if "profile_id" in data:
198
+ data["session_id"] = data["profile_id"]
199
+ return data
200
+
175
201
 
176
202
  class BrowserProfilesResponse(BaseModel):
177
203
  """Response model for listing browser profiles."""
@@ -198,6 +224,14 @@ class BrowserProfilesResponse(BaseModel):
198
224
  warnings.warn("'session_ids' is deprecated, use 'profile_ids' instead", DeprecationWarning, stacklevel=2)
199
225
  self.profile_ids = value
200
226
 
227
+ def model_dump(self, **kwargs) -> dict[str, Any]:
228
+ """Dump model to dict, including deprecated session_ids for retrocompatibility."""
229
+ data = super().model_dump(**kwargs)
230
+ # Add deprecated session_ids field for retrocompatibility
231
+ if "profile_ids" in data:
232
+ data["session_ids"] = data["profile_ids"]
233
+ return data
234
+
201
235
 
202
236
  class BrowserSessionsResponse(BrowserProfilesResponse):
203
237
  """Response model for listing browser profiles."""
@@ -343,7 +377,7 @@ class TaskHandle:
343
377
  time.sleep(poll_interval)
344
378
  raise TimeoutError(f"Task {self.id()} did not complete within {timeout} seconds.")
345
379
 
346
- def live_url(self, interactive: bool = True, embed: bool = False, timeout: int | None = None):
380
+ def live_url(self, interactive: bool = False, embed: bool = False, timeout: int | None = None):
347
381
  """Returns the live URL for the task."""
348
382
  if self._task_response and self._task_response.live_url:
349
383
  return _encode_url(self._task_response.live_url, interactive=interactive, embed=embed)