smooth-py 0.2.8.dev20251008__py3-none-any.whl → 0.2.8.dev20251009__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
@@ -13,13 +13,13 @@ from typing import Any, Literal, Type
13
13
  import httpx
14
14
  import requests
15
15
  from deprecated import deprecated
16
- from pydantic import BaseModel, ConfigDict, Field, model_validator
16
+ from pydantic import BaseModel, ConfigDict, Field, computed_field, model_validator
17
17
 
18
18
  # Configure logging
19
19
  logger = logging.getLogger("smooth")
20
20
 
21
21
 
22
- BASE_URL = "https://api2.circlemind.co/api/"
22
+ BASE_URL = "https://api.smooth.sh/api/"
23
23
 
24
24
 
25
25
  # --- Utils ---
@@ -100,11 +100,12 @@ class TaskRequest(BaseModel):
100
100
  @model_validator(mode="before")
101
101
  @classmethod
102
102
  def _handle_deprecated_session_id(cls, data: Any) -> Any:
103
- if isinstance(data, dict) and "session_id" in data:
103
+ if isinstance(data, dict) and "session_id" in data and "profile_id" not in data:
104
104
  warnings.warn("'session_id' is deprecated, use 'profile_id' instead", DeprecationWarning, stacklevel=2)
105
105
  data["profile_id"] = data.pop("session_id")
106
106
  return data
107
107
 
108
+ @computed_field(return_type=str | None)
108
109
  @property
109
110
  def session_id(self):
110
111
  """(Deprecated) Returns the session ID."""
@@ -137,11 +138,12 @@ class BrowserSessionRequest(BaseModel):
137
138
  @model_validator(mode="before")
138
139
  @classmethod
139
140
  def _handle_deprecated_session_id(cls, data: Any) -> Any:
140
- if isinstance(data, dict) and "session_id" in data:
141
+ if isinstance(data, dict) and "session_id" in data and "profile_id" not in data:
141
142
  warnings.warn("'session_id' is deprecated, use 'profile_id' instead", DeprecationWarning, stacklevel=2)
142
143
  data["profile_id"] = data.pop("session_id")
143
144
  return data
144
145
 
146
+ @computed_field(return_type=str | None)
145
147
  @property
146
148
  def session_id(self):
147
149
  """(Deprecated) Returns the session ID."""
@@ -173,11 +175,12 @@ class BrowserSessionResponse(BaseModel):
173
175
  @model_validator(mode="before")
174
176
  @classmethod
175
177
  def _handle_deprecated_session_id(cls, data: Any) -> Any:
176
- if isinstance(data, dict) and "session_id" in data:
178
+ if isinstance(data, dict) and "session_id" in data and "profile_id" not in data:
177
179
  warnings.warn("'session_id' is deprecated, use 'profile_id' instead", DeprecationWarning, stacklevel=2)
178
180
  data["profile_id"] = data.pop("session_id")
179
181
  return data
180
182
 
183
+ @computed_field(return_type=str | None)
181
184
  @property
182
185
  def session_id(self):
183
186
  """(Deprecated) Returns the session ID."""
@@ -190,14 +193,6 @@ class BrowserSessionResponse(BaseModel):
190
193
  warnings.warn("'session_id' is deprecated, use 'profile_id' instead", DeprecationWarning, stacklevel=2)
191
194
  self.profile_id = value
192
195
 
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
-
201
196
 
202
197
  class BrowserProfilesResponse(BaseModel):
203
198
  """Response model for listing browser profiles."""
@@ -207,11 +202,12 @@ class BrowserProfilesResponse(BaseModel):
207
202
  @model_validator(mode="before")
208
203
  @classmethod
209
204
  def _handle_deprecated_session_ids(cls, data: Any) -> Any:
210
- if isinstance(data, dict) and "session_ids" in data:
205
+ if isinstance(data, dict) and "session_ids" in data and "profile_ids" not in data:
211
206
  warnings.warn("'session_ids' is deprecated, use 'profile_ids' instead", DeprecationWarning, stacklevel=2)
212
207
  data["profile_ids"] = data.pop("session_ids")
213
208
  return data
214
209
 
210
+ @computed_field(return_type=list[str])
215
211
  @property
216
212
  def session_ids(self):
217
213
  """(Deprecated) Returns the session IDs."""
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: smooth-py
3
- Version: 0.2.8.dev20251008
3
+ Version: 0.2.8.dev20251009
4
4
  Summary:
5
5
  Author: Luca Pinchetti
6
6
  Author-email: luca@circlemind.co
@@ -0,0 +1,6 @@
1
+ smooth/__init__.py,sha256=4jYb61Mn-G6GIjIi4rXvzXQY7yWHfIOVvik8RNNJWcU,37701
2
+ smooth/mcp/__init__.py,sha256=0aJVFi2a8Ah3-5xtgyZ5UMbaaJsBWu2T8QLWoFQITk8,219
3
+ smooth/mcp/server.py,sha256=9SymTD4NOGTMN8P-LNGlvYNvv81yCIZfZeeuhEcAc6s,20068
4
+ smooth_py-0.2.8.dev20251009.dist-info/METADATA,sha256=pyfY6EygBMxQnAoLN8NxgbqwD28XFzCJe24HXCcuaaY,7529
5
+ smooth_py-0.2.8.dev20251009.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
6
+ smooth_py-0.2.8.dev20251009.dist-info/RECORD,,
@@ -1,6 +0,0 @@
1
- smooth/__init__.py,sha256=UFvVVla_T5EiOYimpxKQs0D24-F0ZZyRnl1hpJ8YohA,37737
2
- smooth/mcp/__init__.py,sha256=0aJVFi2a8Ah3-5xtgyZ5UMbaaJsBWu2T8QLWoFQITk8,219
3
- smooth/mcp/server.py,sha256=9SymTD4NOGTMN8P-LNGlvYNvv81yCIZfZeeuhEcAc6s,20068
4
- smooth_py-0.2.8.dev20251008.dist-info/METADATA,sha256=Ya-GED2N4TX7XU3MF0Cmy4PaWpwEF45-agZY9daW5F0,7529
5
- smooth_py-0.2.8.dev20251008.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
6
- smooth_py-0.2.8.dev20251008.dist-info/RECORD,,