diff --git a/runware/__init__.py b/runware/__init__.py index 393f352..60d3571 100644 --- a/runware/__init__.py +++ b/runware/__init__.py @@ -4,6 +4,6 @@ from .base import * from .logging_config import * from .async_retry import * +from .version import __version__ __all__ = ["Runware"] -__version__ = "0.4.33" diff --git a/runware/server.py b/runware/server.py index 62909dc..f4c73ac 100644 --- a/runware/server.py +++ b/runware/server.py @@ -21,6 +21,7 @@ Environment, ListenerType, ) +from .version import __version__ class RunwareServer(RunwareBase): def __init__( @@ -47,13 +48,17 @@ def __init__( self._retry_delay: int = retry_delay self._heartbeat_task: Optional[asyncio.Task] = None self._tasks: Dict[str, asyncio.Task] = {} + self._additional_headers: Dict[str, str] = { + "X-SDK-Type": "python", + "X-SDK-Version": __version__ + } async def connect(self): self.logger.info("Connecting to Runware server from server") self._last_pong_time = time.perf_counter() try: - self._ws = await websockets.connect(self._url) + self._ws = await websockets.connect(self._url, additional_headers=self._additional_headers) self._ws.close_timeout = 1 self._ws.max_size = None self.logger.info(f"Connected to WebSocket URL: {self._url}") diff --git a/runware/types.py b/runware/types.py index 14dcede..284efe8 100644 --- a/runware/types.py +++ b/runware/types.py @@ -1139,6 +1139,15 @@ class IVideoInference: inputs: Optional[IVideoInputs] = None skipResponse: Optional[bool] = False + def __post_init__(self): + if self.skipResponse: + warnings.warn( + "The 'skipResponse' parameter is deprecated and will be removed in a future release. " + "Use 'getResponse(taskUUID=taskUUID)' instead to retrieve results asynchronously.", + DeprecationWarning, + stacklevel=3 + ) + @dataclass class IAudioInputs(BaseRequestField): diff --git a/runware/version.py b/runware/version.py new file mode 100644 index 0000000..c25472a --- /dev/null +++ b/runware/version.py @@ -0,0 +1,2 @@ +__version__ = "0.4.33" + diff --git a/setup.py b/setup.py index 942f6f3..4a2d173 100644 --- a/setup.py +++ b/setup.py @@ -9,10 +9,10 @@ version="0.4.33", author="Runware Inc.", author_email="python.sdk@runware.ai", - description="The Python Runware SDK is used to run image inference with the Runware API, powered by the Runware inference platform. It can be used to generate images with text-to-image and image-to-image. It also allows the use of an existing gallery of models or selecting any model or LoRA from the CivitAI gallery. The API also supports upscaling, background removal, inpainting and outpainting, and a series of other ControlNet models.", + description="The Python Runware SDK is used to interact with the Runware API, powered by the Runware inference platform. It supports image generation, video generation, image upscale, video upscale, image caption, video caption, image background removal, video background removal, audio generation, and more. It also allows the use of an existing gallery of models or selecting any model or LoRA from the CivitAI gallery. The API also supports inpainting, outpainting, and a series of other ControlNet models.", long_description=long_description, long_description_content_type="text/markdown", - keywords=["Runware", "stable diffusion", "text to image", "image to text"], + keywords=["Runware", "stable diffusion", "text to image", "image to text", "text to video", "image to video", "video generation", "text to audio", "audio generation", "image upscale", "video upscale", "background removal"], url="https://github.com/runware/sdk-python", project_urls={ "Documentation": "https://docs.runware.ai/",