smooth-py 0.2.8.dev20251009__py3-none-any.whl → 0.3.0.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 +29 -6
- {smooth_py-0.2.8.dev20251009.dist-info → smooth_py-0.3.0.dev20251009.dist-info}/METADATA +1 -1
- smooth_py-0.3.0.dev20251009.dist-info/RECORD +6 -0
- smooth_py-0.2.8.dev20251009.dist-info/RECORD +0 -6
- {smooth_py-0.2.8.dev20251009.dist-info → smooth_py-0.3.0.dev20251009.dist-info}/WHEEL +0 -0
smooth/__init__.py
CHANGED
|
@@ -347,12 +347,7 @@ class TaskHandle:
|
|
|
347
347
|
|
|
348
348
|
def stop(self):
|
|
349
349
|
"""Stops the task."""
|
|
350
|
-
|
|
351
|
-
response = self._client._client.delete(f"{self._client.base_url}/task/{self._id}")
|
|
352
|
-
self._handle_response(response)
|
|
353
|
-
except requests.exceptions.RequestException as e:
|
|
354
|
-
logger.error(f"Request failed: {e}")
|
|
355
|
-
raise ApiError(status_code=0, detail=f"Request failed: {str(e)}") from None
|
|
350
|
+
self._client._delete_task(self._id)
|
|
356
351
|
|
|
357
352
|
def result(self, timeout: int | None = None, poll_interval: float = 1) -> TaskResponse:
|
|
358
353
|
"""Waits for the task to complete and returns the result."""
|
|
@@ -448,6 +443,18 @@ class SmoothClient(BaseClient):
|
|
|
448
443
|
logger.error(f"Request failed: {e}")
|
|
449
444
|
raise ApiError(status_code=0, detail=f"Request failed: {str(e)}") from None
|
|
450
445
|
|
|
446
|
+
def _delete_task(self, task_id: str):
|
|
447
|
+
"""Deletes a task."""
|
|
448
|
+
if not task_id:
|
|
449
|
+
raise ValueError("Task ID cannot be empty.")
|
|
450
|
+
|
|
451
|
+
try:
|
|
452
|
+
response = self._session.delete(f"{self.base_url}/task/{task_id}")
|
|
453
|
+
self._handle_response(response)
|
|
454
|
+
except requests.exceptions.RequestException as e:
|
|
455
|
+
logger.error(f"Request failed: {e}")
|
|
456
|
+
raise ApiError(status_code=0, detail=f"Request failed: {str(e)}") from None
|
|
457
|
+
|
|
451
458
|
def run(
|
|
452
459
|
self,
|
|
453
460
|
task: str,
|
|
@@ -656,6 +663,10 @@ class AsyncTaskHandle:
|
|
|
656
663
|
"""Returns the task ID."""
|
|
657
664
|
return self._id
|
|
658
665
|
|
|
666
|
+
async def stop(self):
|
|
667
|
+
"""Stops the task."""
|
|
668
|
+
await self._client._delete_task(self._id)
|
|
669
|
+
|
|
659
670
|
async def result(self, timeout: int | None = None, poll_interval: float = 1) -> TaskResponse:
|
|
660
671
|
"""Waits for the task to complete and returns the result."""
|
|
661
672
|
if self._task_response and self._task_response.status not in ["running", "waiting"]:
|
|
@@ -745,6 +756,18 @@ class SmoothAsyncClient(BaseClient):
|
|
|
745
756
|
logger.error(f"Request failed: {e}")
|
|
746
757
|
raise ApiError(status_code=0, detail=f"Request failed: {str(e)}") from None
|
|
747
758
|
|
|
759
|
+
async def _delete_task(self, task_id: str):
|
|
760
|
+
"""Deletes a task asynchronously."""
|
|
761
|
+
if not task_id:
|
|
762
|
+
raise ValueError("Task ID cannot be empty.")
|
|
763
|
+
|
|
764
|
+
try:
|
|
765
|
+
response = await self._client.delete(f"{self.base_url}/task/{task_id}")
|
|
766
|
+
self._handle_response(response)
|
|
767
|
+
except httpx.RequestError as e:
|
|
768
|
+
logger.error(f"Request failed: {e}")
|
|
769
|
+
raise ApiError(status_code=0, detail=f"Request failed: {str(e)}") from None
|
|
770
|
+
|
|
748
771
|
async def run(
|
|
749
772
|
self,
|
|
750
773
|
task: str,
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
smooth/__init__.py,sha256=0dn5X327eZwSdXklCCV4KN9L9-353GtmzaqjNs9_HeQ,38407
|
|
2
|
+
smooth/mcp/__init__.py,sha256=0aJVFi2a8Ah3-5xtgyZ5UMbaaJsBWu2T8QLWoFQITk8,219
|
|
3
|
+
smooth/mcp/server.py,sha256=9SymTD4NOGTMN8P-LNGlvYNvv81yCIZfZeeuhEcAc6s,20068
|
|
4
|
+
smooth_py-0.3.0.dev20251009.dist-info/METADATA,sha256=cQ0TzuWCfXke3Rf7Zrp01lPUypKpOc2AB2tSQAx-wf8,7529
|
|
5
|
+
smooth_py-0.3.0.dev20251009.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
|
|
6
|
+
smooth_py-0.3.0.dev20251009.dist-info/RECORD,,
|
|
@@ -1,6 +0,0 @@
|
|
|
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,,
|
|
File without changes
|