diff --git a/pyproject.toml b/pyproject.toml index 268f2cf..98fe24b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "zai-sdk" -version = "0.0.3.2" +version = "0.0.3.3" description = "A SDK library for accessing big model apis from Z.ai" authors = ["Z.ai"] readme = "README.md" diff --git a/src/zai/_version.py b/src/zai/_version.py index a1e3f00..1008213 100644 --- a/src/zai/_version.py +++ b/src/zai/_version.py @@ -1,2 +1,2 @@ __title__ = 'Z.ai' -__version__ = '0.0.3.2' +__version__ = '0.0.3.3' diff --git a/src/zai/api_resource/audio/audio.py b/src/zai/api_resource/audio/audio.py index 3ec6c91..9523f47 100644 --- a/src/zai/api_resource/audio/audio.py +++ b/src/zai/api_resource/audio/audio.py @@ -103,6 +103,7 @@ class Audio(BaseAPI): extra_headers: Headers | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + watermark_enabled: Optional[bool] | NotGiven = NOT_GIVEN, ) -> HttpxBinaryResponseContent: """ Generate customized speech audio with voice cloning @@ -119,6 +120,7 @@ class Audio(BaseAPI): extra_headers (Headers): Additional headers to send extra_body (Body): Additional body parameters timeout (float | httpx.Timeout): Request timeout + watermark_enabled (Optional[bool]): Whether to enable watermark on generated audio """ body = deepcopy_minimal( { @@ -130,6 +132,7 @@ class Audio(BaseAPI): 'sensitive_word_check': sensitive_word_check, 'request_id': request_id, 'user_id': user_id, + 'watermark_enabled': watermark_enabled, } ) files = extract_files(cast(Mapping[str, object], body), paths=[['voice_data']]) diff --git a/src/zai/api_resource/chat/async_completions.py b/src/zai/api_resource/chat/async_completions.py index ec632ea..6d0c6a7 100644 --- a/src/zai/api_resource/chat/async_completions.py +++ b/src/zai/api_resource/chat/async_completions.py @@ -59,6 +59,7 @@ class AsyncCompletions(BaseAPI): timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, response_format: object | None = None, thinking: object | None = None, + watermark_enabled: Optional[bool] | NotGiven = NOT_GIVEN, ) -> AsyncTaskStatus: """ Create an asynchronous chat completion task @@ -84,6 +85,7 @@ class AsyncCompletions(BaseAPI): timeout (float | httpx.Timeout): Request timeout response_format (Optional[object]): Response format specification thinking (Optional[object]): Configuration parameters for model reasoning + watermark_enabled (Optional[bool]): Whether to enable watermark on generated audio """ _cast_type = AsyncTaskStatus logger.debug(f'temperature:{temperature}, top_p:{top_p}') @@ -128,6 +130,7 @@ class AsyncCompletions(BaseAPI): 'extra': maybe_transform(extra, code_geex_params.CodeGeexExtra), 'response_format': response_format, 'thinking': thinking, + 'watermark_enabled': watermark_enabled, } return self._post( '/async/chat/completions', diff --git a/src/zai/api_resource/chat/completions.py b/src/zai/api_resource/chat/completions.py index 9a503f2..95d9ad8 100644 --- a/src/zai/api_resource/chat/completions.py +++ b/src/zai/api_resource/chat/completions.py @@ -65,6 +65,7 @@ class Completions(BaseAPI): timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, response_format: object | None = None, thinking: object | None = None, + watermark_enabled: Optional[bool] | NotGiven = NOT_GIVEN, ) -> Completion | StreamResponse[ChatCompletionChunk]: """ Create a chat completion @@ -91,6 +92,7 @@ class Completions(BaseAPI): timeout (float | httpx.Timeout): Request timeout response_format (object): Response format specification thinking (Optional[object]): Configuration parameters for model reasoning + watermark_enabled (Optional[bool]): Whether to enable watermark on generated audio """ logger.debug(f'temperature:{temperature}, top_p:{top_p}') if temperature is not None and temperature != NOT_GIVEN: @@ -138,6 +140,7 @@ class Completions(BaseAPI): 'extra': maybe_transform(extra, code_geex_params.CodeGeexExtra), 'response_format': response_format, 'thinking': thinking, + 'watermark_enabled': watermark_enabled, } ) return self._post( diff --git a/src/zai/api_resource/images/images.py b/src/zai/api_resource/images/images.py index bda7556..dce31fd 100644 --- a/src/zai/api_resource/images/images.py +++ b/src/zai/api_resource/images/images.py @@ -38,6 +38,7 @@ class Images(BaseAPI): extra_body: Body | None = None, disable_strict_validation: Optional[bool] | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + watermark_enabled: Optional[bool] | NotGiven = NOT_GIVEN, ) -> ImagesResponded: """ Generate images from text prompts @@ -58,6 +59,7 @@ class Images(BaseAPI): extra_body (Body): Additional body parameters disable_strict_validation (Optional[bool]): Whether to disable strict validation timeout (float | httpx.Timeout): Request timeout + watermark_enabled (Optional[bool]): Whether to enable watermark on generated images """ _cast_type = ImagesResponded if disable_strict_validation: @@ -76,6 +78,7 @@ class Images(BaseAPI): 'user': user, 'user_id': user_id, 'request_id': request_id, + 'watermark_enabled': watermark_enabled, }, options=make_request_options(extra_headers=extra_headers, extra_body=extra_body, timeout=timeout), cast_type=_cast_type, diff --git a/src/zai/api_resource/videos/videos.py b/src/zai/api_resource/videos/videos.py index c4525de..ac594d1 100644 --- a/src/zai/api_resource/videos/videos.py +++ b/src/zai/api_resource/videos/videos.py @@ -49,6 +49,7 @@ class Videos(BaseAPI): extra_headers: Headers | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + watermark_enabled: Optional[bool] | NotGiven = NOT_GIVEN, ) -> VideoObject: """ Generate videos from text prompts or images @@ -71,6 +72,7 @@ class Videos(BaseAPI): extra_headers (Headers): Additional headers to send extra_body (Body): Additional body parameters timeout (float | httpx.Timeout): Request timeout + watermark_enabled (Optional[bool]): Whether to enable watermark on generated videos """ if not model: raise ValueError('`model` must be provided.') @@ -90,6 +92,7 @@ class Videos(BaseAPI): 'sensitive_word_check': sensitive_word_check, 'request_id': request_id, 'user_id': user_id, + 'watermark_enabled': watermark_enabled, } ) return self._post(