Spaces:
Running
Running
Fix: add wavespeed to requirements, make SDK import optional
Browse files
requirements.txt
CHANGED
|
@@ -15,3 +15,4 @@ python-multipart>=0.0.6
|
|
| 15 |
python-dotenv>=1.0.0
|
| 16 |
runpod>=1.6.0
|
| 17 |
paramiko>=3.4.0
|
|
|
|
|
|
| 15 |
python-dotenv>=1.0.0
|
| 16 |
runpod>=1.6.0
|
| 17 |
paramiko>=3.4.0
|
| 18 |
+
wavespeed
|
src/content_engine/services/cloud_providers/wavespeed_provider.py
CHANGED
|
@@ -27,7 +27,13 @@ import uuid
|
|
| 27 |
from typing import Any
|
| 28 |
|
| 29 |
import httpx
|
| 30 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 31 |
|
| 32 |
from content_engine.services.cloud_providers.base import CloudGenerationResult, CloudProvider
|
| 33 |
|
|
@@ -166,7 +172,7 @@ class WaveSpeedProvider(CloudProvider):
|
|
| 166 |
|
| 167 |
def __init__(self, api_key: str):
|
| 168 |
self._api_key = api_key
|
| 169 |
-
self._client = WaveSpeedClient(api_key=api_key)
|
| 170 |
self._http_client = httpx.AsyncClient(timeout=300)
|
| 171 |
|
| 172 |
@property
|
|
|
|
| 27 |
from typing import Any
|
| 28 |
|
| 29 |
import httpx
|
| 30 |
+
|
| 31 |
+
try:
|
| 32 |
+
from wavespeed import Client as WaveSpeedClient
|
| 33 |
+
_SDK_AVAILABLE = True
|
| 34 |
+
except ImportError:
|
| 35 |
+
WaveSpeedClient = None
|
| 36 |
+
_SDK_AVAILABLE = False
|
| 37 |
|
| 38 |
from content_engine.services.cloud_providers.base import CloudGenerationResult, CloudProvider
|
| 39 |
|
|
|
|
| 172 |
|
| 173 |
def __init__(self, api_key: str):
|
| 174 |
self._api_key = api_key
|
| 175 |
+
self._client = WaveSpeedClient(api_key=api_key) if _SDK_AVAILABLE else None
|
| 176 |
self._http_client = httpx.AsyncClient(timeout=300)
|
| 177 |
|
| 178 |
@property
|