smooth-py 0.1.1__py3-none-any.whl → 0.1.1.post0__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
@@ -109,10 +109,10 @@ class BaseClient:
109
109
  """Initializes the base client."""
110
110
  # Try to get API key from environment if not provided
111
111
  if not api_key:
112
- api_key = os.getenv("SMOOTH_API_KEY")
112
+ api_key = os.getenv("CIRCLEMIND_API_KEY")
113
113
 
114
114
  if not api_key:
115
- raise ValueError("API key is required. Provide it directly or set SMOOTH_API_KEY environment variable.")
115
+ raise ValueError("API key is required. Provide it directly or set CIRCLEMIND_API_KEY environment variable.")
116
116
 
117
117
  if not base_url:
118
118
  raise ValueError("Base URL cannot be empty.")
@@ -120,7 +120,7 @@ class BaseClient:
120
120
  self.api_key = api_key
121
121
  self.base_url = f"{base_url.rstrip('/')}/{api_version}"
122
122
  self.headers = {
123
- "Authorization": f"Bearer {self.api_key}",
123
+ "apikey": self.api_key,
124
124
  "Content-Type": "application/json",
125
125
  "User-Agent": "smooth-python-sdk/0.1.0",
126
126
  }
@@ -431,6 +431,23 @@ class AsyncClient(BaseClient):
431
431
  logger.error(f"Request failed: {e}")
432
432
  raise ApiError(status_code=0, detail=f"Request failed: {str(e)}") from None
433
433
 
434
+ async def list_sessions(self) -> BrowserSessionsResponse:
435
+ """Lists all browser sessions for the user.
436
+
437
+ Returns:
438
+ A list of existing browser sessions.
439
+
440
+ Raises:
441
+ ApiException: If the API request fails.
442
+ """
443
+ try:
444
+ response = await self._client.get(f"{self.base_url}/browser/session")
445
+ data = self._handle_response(response)
446
+ return BrowserSessionsResponse(**data["r"])
447
+ except httpx.RequestError as e:
448
+ logger.error(f"Request failed: {e}")
449
+ raise ApiError(status_code=0, detail=f"Request failed: {str(e)}") from None
450
+
434
451
  async def close(self):
435
452
  """Closes the async client session."""
436
453
  await self._client.aclose()
@@ -1,9 +1,9 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: smooth-py
3
- Version: 0.1.1
3
+ Version: 0.1.1.post0
4
4
  Summary:
5
5
  Author: Luca Pinchetti
6
- Author-email: pincoluca1@gmail.com
6
+ Author-email: luca@circlemind.co
7
7
  Requires-Python: >=3.10
8
8
  Classifier: Programming Language :: Python :: 3
9
9
  Classifier: Programming Language :: Python :: 3.10
@@ -46,10 +46,10 @@ The SDK requires an API key for authentication. You can provide the API key in t
46
46
 
47
47
  2. **As an environment variable**:
48
48
 
49
- Set the `SMOOTH_API_KEY` environment variable, and the client will automatically use it.
49
+ Set the `CIRCLEMIND_API_KEY` environment variable, and the client will automatically use it.
50
50
 
51
51
  ```bash
52
- export SMOOTH_API_KEY="YOUR_API_KEY"
52
+ export CIRCLEMIND_API_KEY="YOUR_API_KEY"
53
53
  ```
54
54
 
55
55
  ```python
@@ -0,0 +1,4 @@
1
+ smooth/__init__.py,sha256=cAEweO-FSsk9eIAp_068Gm1s8FdylhRKV9W707kNX88,15745
2
+ smooth_py-0.1.1.post0.dist-info/METADATA,sha256=1FsW9jkuCBaE085DcMd0PzYE-fM7mLXx8i0JxQzWC8Y,4645
3
+ smooth_py-0.1.1.post0.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
4
+ smooth_py-0.1.1.post0.dist-info/RECORD,,
@@ -1,4 +0,0 @@
1
- smooth/__init__.py,sha256=7di8KFljmHr25nn_P4aqvnX-bu5pYKaO9Phx_lRP3Yg,15178
2
- smooth_py-0.1.1.dist-info/METADATA,sha256=41xalFCzT0QROvjdDmLf5QICAHbddCPtCzh1WwHd9Os,4633
3
- smooth_py-0.1.1.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
4
- smooth_py-0.1.1.dist-info/RECORD,,