Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.12.0
0.13.0
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "arkruntime"
version = "0.12.0"
version = "0.13.0"
description = "Ark runtime SDK for Python"
readme = "README.md"
requires-python = ">=3.8"
Expand Down
90 changes: 90 additions & 0 deletions src/arkruntime/types/audio_generation/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
# Generated by datamodel-code-generator from ark-apis typespec/openapi.
# DO NOT EDIT — regenerate with `make gen-py-<api>` in ark-apis.
#
# Copyright (c) 2026 ByteDance Ltd. and/or its affiliates.
# SPDX-License-Identifier: Apache-2.0

from __future__ import annotations

from .audio_config import AudioConfig
from .audio_content import AudioContent
from .audio_generation_request import AudioGenerationRequest
from .audio_generation_response import AudioGenerationResponse
from .audio_role import AudioRole
from .audio_url import AudioURL
from .content import Content
from .dubbing_config import DubbingConfig
from .effective_dubbing_config import EffectiveDubbingConfig
from .error_response import ErrorResponse
from .glossaries import Glossaries
from .glossary import Glossary
from .image_content import ImageContent
from .image_url import ImageURL
from .include import Include
from .non_empty_string import NonEmptyString
from .output_format import OutputFormat
from .pitch_rate import PitchRate
from .rate import Rate
from .response_audio import ResponseAudio
from .response_content import ResponseContent
from .response_error import ResponseError
from .response_subtitle import ResponseSubtitle
from .sample_rate import SampleRate
from .target_language import TargetLanguage
from .text_content import TextContent
from .usage import Usage
from .video_content import VideoContent
from .video_role import VideoRole
from .video_url import VideoURL

__all__ = [
"AudioConfig",
"AudioContent",
"AudioGenerationRequest",
"AudioGenerationResponse",
"AudioRole",
"AudioURL",
"Content",
"DubbingConfig",
"EffectiveDubbingConfig",
"ErrorResponse",
"Glossaries",
"Glossary",
"ImageContent",
"ImageURL",
"Include",
"NonEmptyString",
"OutputFormat",
"PitchRate",
"Rate",
"ResponseAudio",
"ResponseContent",
"ResponseError",
"ResponseSubtitle",
"SampleRate",
"TargetLanguage",
"TextContent",
"Usage",
"VideoContent",
"VideoRole",
"VideoURL",
]
from .audio_config_param import AudioConfigParam
from .audio_content_param import AudioContentParam
from .audio_generation_request_param import AudioGenerationRequestParam
from .audio_url_param import AudioURLParam
from .content_param import ContentParam
from .dubbing_config_param import DubbingConfigParam
from .glossaries_param import GlossariesParam
from .glossary_param import GlossaryParam
from .image_content_param import ImageContentParam
from .image_url_param import ImageURLParam
from .non_empty_string_param import NonEmptyStringParam
from .pitch_rate_param import PitchRateParam
from .rate_param import RateParam
from .text_content_param import TextContentParam
from .video_content_param import VideoContentParam
from .video_url_param import VideoURLParam

# Hand-written extras (preserved across regen via Makefile rsync --exclude=*_shim.py).
from ._init_extras_shim import * # noqa: F401,F403
12 changes: 12 additions & 0 deletions src/arkruntime/types/audio_generation/_init_extras_shim.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Copyright (c) 2026 ByteDance Ltd. and/or its affiliates.
# SPDX-License-Identifier: Apache-2.0

"""Hand-written extras shim for the audio_generation API (empty stub).

Preserved across regen via the Makefile rsync --exclude=*_shim.py rule.
Add re-exports here as needed.
"""

from __future__ import annotations

__all__: list[str] = []
34 changes: 34 additions & 0 deletions src/arkruntime/types/audio_generation/audio_config.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Generated by datamodel-code-generator from ark-apis typespec/openapi.
# DO NOT EDIT — regenerate with `make gen-py-<api>` in ark-apis.
#
# Copyright (c) 2026 ByteDance Ltd. and/or its affiliates.
# SPDX-License-Identifier: Apache-2.0

from __future__ import annotations

from typing import Optional

from arkruntime._models import BaseModel

from .pitch_rate import PitchRate
from .rate import Rate
from .sample_rate import SampleRate


class AudioConfig(BaseModel):
sample_rate: Optional[SampleRate] = None
"""
Defaults to 44100 for wav/mp3/pcm and 48000 for ogg_opus. ogg_opus only accepts 48000. Explicit zero is invalid.
"""
speech_rate: Optional[Rate] = None
"""
Reference generation only. Default 0; -50 means 0.5x and 100 means 2x. Must be omitted (or null) for dubbing/separation, even when the value would be 0.
"""
loudness_rate: Optional[Rate] = None
"""
Reference generation only. Default 0; -50 means 0.5x and 100 means 2x. Must be omitted (or null) for dubbing/separation.
"""
pitch_rate: Optional[PitchRate] = None
"""
Reference generation only. Default 0. Must be omitted (or null) for dubbing/separation.
"""
29 changes: 29 additions & 0 deletions src/arkruntime/types/audio_generation/audio_config_param.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Generated by datamodel-code-generator from ark-apis typespec/openapi.
# DO NOT EDIT — regenerate with `make gen-py-<api>` in ark-apis.
#
# Copyright (c) 2026 ByteDance Ltd. and/or its affiliates.
# SPDX-License-Identifier: Apache-2.0

from __future__ import annotations

from typing import Optional

from typing_extensions import TypedDict

from .pitch_rate_param import PitchRateParam
from .rate_param import RateParam
from .sample_rate import SampleRate


class AudioConfigParam(TypedDict, total=False):
sample_rate: Optional[Optional[SampleRate]]
"""Defaults to 44100 for wav/mp3/pcm and 48000 for ogg_opus. ogg_opus only accepts 48000. Explicit zero is invalid."""

speech_rate: Optional[Optional[RateParam]]
"""Reference generation only. Default 0; -50 means 0.5x and 100 means 2x. Must be omitted (or null) for dubbing/separation, even when the value would be 0."""

loudness_rate: Optional[Optional[RateParam]]
"""Reference generation only. Default 0; -50 means 0.5x and 100 means 2x. Must be omitted (or null) for dubbing/separation."""

pitch_rate: Optional[Optional[PitchRateParam]]
"""Reference generation only. Default 0. Must be omitted (or null) for dubbing/separation."""
23 changes: 23 additions & 0 deletions src/arkruntime/types/audio_generation/audio_content.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Generated by datamodel-code-generator from ark-apis typespec/openapi.
# DO NOT EDIT — regenerate with `make gen-py-<api>` in ark-apis.
#
# Copyright (c) 2026 ByteDance Ltd. and/or its affiliates.
# SPDX-License-Identifier: Apache-2.0

from __future__ import annotations

from typing import Literal

from arkruntime._models import BaseModel

from .audio_role import AudioRole
from .audio_url import AudioURL


class AudioContent(BaseModel):
type: Literal["audio_url"]
audio_url: AudioURL
role: AudioRole
"""
Required. reference_audio selects reference generation; separate_audio selects audio separation.
"""
23 changes: 23 additions & 0 deletions src/arkruntime/types/audio_generation/audio_content_param.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Generated by datamodel-code-generator from ark-apis typespec/openapi.
# DO NOT EDIT — regenerate with `make gen-py-<api>` in ark-apis.
#
# Copyright (c) 2026 ByteDance Ltd. and/or its affiliates.
# SPDX-License-Identifier: Apache-2.0

from __future__ import annotations

from typing import Literal

from typing_extensions import Required, TypedDict

from .audio_role import AudioRole
from .audio_url_param import AudioURLParam


class AudioContentParam(TypedDict, total=False):
type: Required[Literal["audio_url"]]

audio_url: Required[AudioURLParam]

role: Required[AudioRole]
"""Required. reference_audio selects reference generation; separate_audio selects audio separation."""
55 changes: 55 additions & 0 deletions src/arkruntime/types/audio_generation/audio_generation_request.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# Generated by datamodel-code-generator from ark-apis typespec/openapi.
# DO NOT EDIT — regenerate with `make gen-py-<api>` in ark-apis.
#
# Copyright (c) 2026 ByteDance Ltd. and/or its affiliates.
# SPDX-License-Identifier: Apache-2.0

from __future__ import annotations

from typing import List, Optional

from typing_extensions import Annotated

from arkruntime._models import BaseModel
from pydantic import Field

from .audio_config import AudioConfig
from .content import Content
from .dubbing_config import DubbingConfig
from .include import Include
from .non_empty_string import NonEmptyString
from .output_format import OutputFormat


class AudioGenerationRequest(BaseModel):
"""
Synchronous reference generation, audio separation or video dubbing.
Static scene rules are attached to required content via dependentSchemas;
media and deployment checks run on the server.
"""

model: NonEmptyString
"""
Model ID or Endpoint ID. Whitespace-only values are rejected.
"""
content: Annotated[List[Content], Field(min_length=1)]
dubbing_config: Optional[DubbingConfig] = None
"""
Required for dubbing; forbidden in reference generation and separation.
"""
output_format: Optional[OutputFormat] = "wav"
"""
Output audio format. Omitted or null resolves to wav.
"""
audio_config: Optional[AudioConfig] = None
"""
Optional output parameters. Defaults are applied by the service.
"""
include: Optional[List[Include]] = None
"""
Additional artifacts; omitted/null/empty means none. video_url requires a video input. subtitles_source.* is only allowed for dubbing. Separation forbids a non-empty include.
"""
watermark: Optional[bool] = False
"""
Append an audible rhythm watermark at the end. Defaults to false. Only supported in the cn-beijing deployment region; overseas deployments reject true with InvalidParameter (param=watermark).
"""
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# Generated by datamodel-code-generator from ark-apis typespec/openapi.
# DO NOT EDIT — regenerate with `make gen-py-<api>` in ark-apis.
#
# Copyright (c) 2026 ByteDance Ltd. and/or its affiliates.
# SPDX-License-Identifier: Apache-2.0

from __future__ import annotations

from typing import List, Optional

from typing_extensions import Required, TypedDict

from .audio_config_param import AudioConfigParam
from .content_param import ContentParam
from .dubbing_config_param import DubbingConfigParam
from .include import Include
from .non_empty_string_param import NonEmptyStringParam
from .output_format import OutputFormat


class AudioGenerationRequestParam(TypedDict, total=False):
"""
Synchronous reference generation, audio separation or video dubbing.
Static scene rules are attached to required content via dependentSchemas;
media and deployment checks run on the server.
"""

model: Required[NonEmptyStringParam]
"""Model ID or Endpoint ID. Whitespace-only values are rejected."""

content: Required[List[ContentParam]]

dubbing_config: Optional[Optional[DubbingConfigParam]]
"""Required for dubbing; forbidden in reference generation and separation."""

output_format: Optional[Optional[OutputFormat]]
"""Output audio format. Omitted or null resolves to wav."""

audio_config: Optional[Optional[AudioConfigParam]]
"""Optional output parameters. Defaults are applied by the service."""

include: Optional[Optional[List[Include]]]
"""Additional artifacts; omitted/null/empty means none. video_url requires a video input. subtitles_source.* is only allowed for dubbing. Separation forbids a non-empty include."""

watermark: Optional[Optional[bool]]
"""Append an audible rhythm watermark at the end. Defaults to false. Only supported in the cn-beijing deployment region; overseas deployments reject true with InvalidParameter (param=watermark)."""
47 changes: 47 additions & 0 deletions src/arkruntime/types/audio_generation/audio_generation_response.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# Generated by datamodel-code-generator from ark-apis typespec/openapi.
# DO NOT EDIT — regenerate with `make gen-py-<api>` in ark-apis.
#
# Copyright (c) 2026 ByteDance Ltd. and/or its affiliates.
# SPDX-License-Identifier: Apache-2.0

from __future__ import annotations

from typing import Literal, Optional

from arkruntime._models import BaseModel

from .audio_config import AudioConfig
from .effective_dubbing_config import EffectiveDubbingConfig
from .output_format import OutputFormat
from .response_content import ResponseContent
from .usage import Usage


class AudioGenerationResponse(BaseModel):
id: str
model: str
"""
Model name/version. Reference generation, audio separation and video dubbing using an agent plan return the brand model identifier; if resolution fails, the request model is returned instead of the underlying routed model.
"""
content: Optional[ResponseContent] = None
dubbing_config: Optional[EffectiveDubbingConfig] = None
"""
Effective dubbing configuration, when applicable.
"""
output_format: Optional[OutputFormat] = None
"""
Dubbing returns the effective format; other scenes echo the supplied request field.
"""
audio_config: Optional[AudioConfig] = None
"""
Dubbing returns the effective sample rate; other scenes echo the supplied request config.
"""
subtitle: Optional[Literal[False]] = None
"""
Separation explicitly returns false. Other scenes currently omit this field; inspect content.subtitles for subtitle artifacts.
"""
created: int
"""
Creation time, Unix seconds.
"""
usage: Optional[Usage] = None
14 changes: 14 additions & 0 deletions src/arkruntime/types/audio_generation/audio_role.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Generated by datamodel-code-generator from ark-apis typespec/openapi.
# DO NOT EDIT — regenerate with `make gen-py-<api>` in ark-apis.
#
# Copyright (c) 2026 ByteDance Ltd. and/or its affiliates.
# SPDX-License-Identifier: Apache-2.0

from __future__ import annotations

from enum import Enum


class AudioRole(str, Enum):
reference_audio = "reference_audio"
separate_audio = "separate_audio"
Loading
Loading