smooth-py 0.2.8.dev20251008__tar.gz → 0.2.8.dev20251009__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.8.dev20251008 → smooth_py-0.2.8.dev20251009}/PKG-INFO +1 -1
- {smooth_py-0.2.8.dev20251008 → smooth_py-0.2.8.dev20251009}/pyproject.toml +1 -1
- {smooth_py-0.2.8.dev20251008 → smooth_py-0.2.8.dev20251009}/src/smooth/__init__.py +10 -14
- {smooth_py-0.2.8.dev20251008 → smooth_py-0.2.8.dev20251009}/README.md +0 -0
- {smooth_py-0.2.8.dev20251008 → smooth_py-0.2.8.dev20251009}/src/smooth/mcp/__init__.py +0 -0
- {smooth_py-0.2.8.dev20251008 → smooth_py-0.2.8.dev20251009}/src/smooth/mcp/server.py +0 -0
|
@@ -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://
|
|
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."""
|
|
File without changes
|
|
File without changes
|
|
File without changes
|