runapi-volcengine-lip-sync 0.2.1__tar.gz → 0.3.0__tar.gz

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.
@@ -1,18 +1,18 @@
1
- Metadata-Version: 2.4
1
+ Metadata-Version: 2.5
2
2
  Name: runapi-volcengine-lip-sync
3
- Version: 0.2.1
3
+ Version: 0.3.0
4
4
  Summary: RunAPI Volcengine Lip Sync SDK for audio-driven video-to-video lip sync workflows in JavaScript, Python, Ruby, Go, Java, and PHP
5
5
  Project-URL: Homepage, https://runapi.ai/models/volcengine-lip-sync
6
6
  Project-URL: Documentation, https://runapi.ai/docs/resources/sdks
7
7
  Project-URL: Source, https://github.com/runapi-ai/volcengine-lip-sync-sdk
8
8
  Project-URL: Issues, https://github.com/runapi-ai/volcengine-lip-sync-sdk/issues
9
9
  Project-URL: Changelog, https://github.com/runapi-ai/volcengine-lip-sync-sdk/blob/main/CHANGELOG.md
10
- Project-URL: Release Notes, https://github.com/runapi-ai/volcengine-lip-sync-sdk/releases/tag/python%2Fv0.2.1
10
+ Project-URL: Release Notes, https://github.com/runapi-ai/volcengine-lip-sync-sdk/releases/tag/python%2Fv0.3.0
11
11
  Author-email: RunAPI <contact@runapi.ai>
12
12
  License-Expression: Apache-2.0
13
13
  Keywords: api,golang,gradle,java,lip-sync,lip-sync-api,maven,python,ruby,runapi,runapi-ai,sdk,typescript,video-api,video-generation,volcengine
14
14
  Requires-Python: >=3.9
15
- Requires-Dist: runapi-core>=0.3.3
15
+ Requires-Dist: runapi-core~=0.10.0
16
16
  Description-Content-Type: text/markdown
17
17
 
18
18
  # Volcengine Lip Sync API Python SDK for RunAPI
@@ -4,14 +4,14 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "runapi-volcengine-lip-sync"
7
- version = "0.2.1"
7
+ version = "0.3.0"
8
8
  description = "RunAPI Volcengine Lip Sync SDK for audio-driven video-to-video lip sync workflows in JavaScript, Python, Ruby, Go, Java, and PHP"
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.9"
11
11
  license = "Apache-2.0"
12
12
  authors = [{ name = "RunAPI", email = "contact@runapi.ai" }]
13
13
  keywords = ["runapi", "runapi-ai", "volcengine", "lip-sync", "api", "sdk", "typescript", "python", "ruby", "golang", "java", "maven", "gradle", "video-generation", "video-api", "lip-sync-api"]
14
- dependencies = ["runapi-core>=0.3.3"]
14
+ dependencies = ["runapi-core~=0.10.0"]
15
15
 
16
16
  [project.urls]
17
17
  Homepage = "https://runapi.ai/models/volcengine-lip-sync"
@@ -19,7 +19,7 @@ Documentation = "https://runapi.ai/docs/resources/sdks"
19
19
  Source = "https://github.com/runapi-ai/volcengine-lip-sync-sdk"
20
20
  Issues = "https://github.com/runapi-ai/volcengine-lip-sync-sdk/issues"
21
21
  Changelog = "https://github.com/runapi-ai/volcengine-lip-sync-sdk/blob/main/CHANGELOG.md"
22
- "Release Notes" = "https://github.com/runapi-ai/volcengine-lip-sync-sdk/releases/tag/python%2Fv0.2.1"
22
+ "Release Notes" = "https://github.com/runapi-ai/volcengine-lip-sync-sdk/releases/tag/python%2Fv0.3.0"
23
23
 
24
24
  [tool.hatch.build.targets.wheel]
25
25
  packages = ["src/runapi"]
@@ -6,7 +6,6 @@ from typing import Any, Optional
6
6
 
7
7
  from runapi.core import Resource, RequestOptions
8
8
 
9
- from ..contract_gen import CONTRACT
10
9
  from ..types import CompletedLipSyncVideoResponse, LipSyncVideoResponse
11
10
 
12
11
 
@@ -26,7 +25,6 @@ class LipSyncVideo(Resource):
26
25
  def create(self, options: Optional[RequestOptions] = None, **params: Any) -> Any:
27
26
  """Create a lip-sync video task and return immediately with an ``id``."""
28
27
  compacted = self._compact_params(params)
29
- self._validate_contract(CONTRACT["lip-sync-video"], compacted)
30
28
  return self._request("post", self.ENDPOINT, body=compacted, options=options)
31
29
 
32
30
  def get(self, id: str, options: Optional[RequestOptions] = None) -> Any:
@@ -1,7 +1,7 @@
1
1
  import pytest
2
2
 
3
3
  from runapi.core import config
4
- from runapi.core.errors import AuthenticationError, ValidationError
4
+ from runapi.core.errors import AuthenticationError
5
5
  from runapi.volcengine_lip_sync import VolcengineLipSyncClient
6
6
  from runapi.volcengine_lip_sync.resources.lip_sync_video import LipSyncVideo
7
7
  from runapi.volcengine_lip_sync.types import CompletedLipSyncVideoResponse, LipSyncVideoResponse
@@ -78,10 +78,8 @@ def test_create_posts_compacted_body():
78
78
  "mode": "lite",
79
79
  "source_video_url": "https://cdn.runapi.ai/public/samples/volcengine-lip-sync-source.mp4",
80
80
  "source_audio_url": "https://cdn.runapi.ai/public/samples/volcengine-lip-sync-voice-adam.mp3",
81
- "enable_vocal_separation": False,
82
- },
83
- ),
84
- ]
81
+ "enable_vocal_separation": False},
82
+ )]
85
83
  assert isinstance(result, LipSyncVideoResponse)
86
84
  assert result.id == "t1"
87
85
 
@@ -98,9 +96,8 @@ def test_run_polls_and_narrows_completed_type():
98
96
  {"id": "t1", "status": "pending"},
99
97
  {
100
98
  "id": "t1",
101
- "status": "completed",
102
- "videos": [{"url": "https://cdn.runapi.ai/public/samples/volcengine-lip-sync-result-adam.mp4"}],
103
- },
99
+ "status": "completed", "usage": {"cost": 0.05},
100
+ "videos": [{"url": "https://cdn.runapi.ai/public/samples/volcengine-lip-sync-result-adam.mp4"}]},
104
101
  )
105
102
  client = VolcengineLipSyncClient(api_key="k", http_client=fake)
106
103
  result = client.lip_sync_video.run(
@@ -113,23 +110,3 @@ def test_run_polls_and_narrows_completed_type():
113
110
  assert isinstance(result, CompletedLipSyncVideoResponse)
114
111
  assert result.videos[0].url == "https://cdn.runapi.ai/public/samples/volcengine-lip-sync-result-adam.mp4"
115
112
  assert [call[0] for call in fake.calls] == ["post", "get"]
116
-
117
-
118
- def test_create_requires_model():
119
- client = VolcengineLipSyncClient(api_key="k", http_client=FakeHttp())
120
- with pytest.raises(ValidationError, match="model must be one of: volcengine-lip-sync"):
121
- client.lip_sync_video.create(
122
- mode="lite",
123
- source_video_url="https://cdn.runapi.ai/public/samples/volcengine-lip-sync-source.mp4",
124
- source_audio_url="https://cdn.runapi.ai/public/samples/volcengine-lip-sync-voice-adam.mp3",
125
- )
126
-
127
-
128
- def test_create_requires_source_audio_url():
129
- client = VolcengineLipSyncClient(api_key="k", http_client=FakeHttp())
130
- with pytest.raises(ValidationError, match="source_audio_url is required"):
131
- client.lip_sync_video.create(
132
- model="volcengine-lip-sync",
133
- mode="lite",
134
- source_video_url="https://cdn.runapi.ai/public/samples/volcengine-lip-sync-source.mp4",
135
- )
@@ -1,38 +0,0 @@
1
- CONTRACT = {
2
- "lip-sync-video": {
3
- "models": ["volcengine-lip-sync"],
4
- "fields_by_model": {
5
- "volcengine-lip-sync": {
6
- "mode": {
7
- "enum": ["lite", "basic"],
8
- "required": True
9
- },
10
- "source_audio_url": {
11
- "required": True
12
- },
13
- "source_video_url": {
14
- "required": True
15
- },
16
- "template_start_seconds": {
17
- "min": 0
18
- }
19
- }
20
- },
21
- "rules": [{
22
- "when": {
23
- "mode": "lite"
24
- },
25
- "forbidden": ["enable_scene_detection"]
26
- }, {
27
- "when": {
28
- "mode": "basic"
29
- },
30
- "forbidden": ["align_audio", "align_audio_reverse", "template_start_seconds"]
31
- }, {
32
- "when": {
33
- "align_audio_reverse": True
34
- },
35
- "required": ["align_audio"]
36
- }]
37
- }
38
- }