runapi-hailuo 0.2.2__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.
- {runapi_hailuo-0.2.2 → runapi_hailuo-0.3.0}/PKG-INFO +3 -3
- {runapi_hailuo-0.2.2 → runapi_hailuo-0.3.0}/pyproject.toml +3 -3
- {runapi_hailuo-0.2.2 → runapi_hailuo-0.3.0}/src/runapi/hailuo/contract_gen.py +13 -2
- {runapi_hailuo-0.2.2 → runapi_hailuo-0.3.0}/src/runapi/hailuo/resources/image_to_video.py +0 -2
- {runapi_hailuo-0.2.2 → runapi_hailuo-0.3.0}/tests/test_client.py +5 -8
- {runapi_hailuo-0.2.2 → runapi_hailuo-0.3.0}/README.md +0 -0
- {runapi_hailuo-0.2.2 → runapi_hailuo-0.3.0}/src/runapi/hailuo/__init__.py +0 -0
- {runapi_hailuo-0.2.2 → runapi_hailuo-0.3.0}/src/runapi/hailuo/client.py +0 -0
- {runapi_hailuo-0.2.2 → runapi_hailuo-0.3.0}/src/runapi/hailuo/py.typed +0 -0
- {runapi_hailuo-0.2.2 → runapi_hailuo-0.3.0}/src/runapi/hailuo/resources/__init__.py +0 -0
- {runapi_hailuo-0.2.2 → runapi_hailuo-0.3.0}/src/runapi/hailuo/resources/text_to_video.py +0 -0
- {runapi_hailuo-0.2.2 → runapi_hailuo-0.3.0}/src/runapi/hailuo/types.py +0 -0
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: runapi-hailuo
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.3.0
|
|
4
4
|
Summary: RunAPI Hailuo SDK for text-to-video and image-to-video workflows in JavaScript, Python, Ruby, Go, Java, and PHP
|
|
5
5
|
Project-URL: Homepage, https://runapi.ai/models/hailuo
|
|
6
6
|
Project-URL: Documentation, https://runapi.ai/docs/resources/sdks
|
|
7
7
|
Project-URL: Source, https://github.com/runapi-ai/hailuo-sdk
|
|
8
8
|
Project-URL: Issues, https://github.com/runapi-ai/hailuo-sdk/issues
|
|
9
9
|
Project-URL: Changelog, https://github.com/runapi-ai/hailuo-sdk/blob/main/CHANGELOG.md
|
|
10
|
-
Project-URL: Release Notes, https://github.com/runapi-ai/hailuo-sdk/releases/tag/python%2Fv0.
|
|
10
|
+
Project-URL: Release Notes, https://github.com/runapi-ai/hailuo-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,hailuo,hailuo-ai-api,java,maven,python,ruby,runapi,runapi-ai,sdk,text-to-video,typescript,video-api,video-generation
|
|
14
14
|
Requires-Python: >=3.9
|
|
15
|
-
Requires-Dist: runapi-core>=0.
|
|
15
|
+
Requires-Dist: runapi-core>=0.9.1
|
|
16
16
|
Description-Content-Type: text/markdown
|
|
17
17
|
|
|
18
18
|
# Hailuo API Python SDK for RunAPI
|
|
@@ -4,14 +4,14 @@ build-backend = "hatchling.build"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "runapi-hailuo"
|
|
7
|
-
version = "0.
|
|
7
|
+
version = "0.3.0"
|
|
8
8
|
description = "RunAPI Hailuo SDK for text-to-video and image-to-video 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", "hailuo", "api", "sdk", "typescript", "python", "ruby", "golang", "java", "maven", "gradle", "video-generation", "text-to-video", "video-api", "hailuo-ai-api"]
|
|
14
|
-
dependencies = ["runapi-core>=0.
|
|
14
|
+
dependencies = ["runapi-core>=0.9.1"]
|
|
15
15
|
|
|
16
16
|
[project.urls]
|
|
17
17
|
Homepage = "https://runapi.ai/models/hailuo"
|
|
@@ -19,7 +19,7 @@ Documentation = "https://runapi.ai/docs/resources/sdks"
|
|
|
19
19
|
Source = "https://github.com/runapi-ai/hailuo-sdk"
|
|
20
20
|
Issues = "https://github.com/runapi-ai/hailuo-sdk/issues"
|
|
21
21
|
Changelog = "https://github.com/runapi-ai/hailuo-sdk/blob/main/CHANGELOG.md"
|
|
22
|
-
"Release Notes" = "https://github.com/runapi-ai/hailuo-sdk/releases/tag/python%2Fv0.
|
|
22
|
+
"Release Notes" = "https://github.com/runapi-ai/hailuo-sdk/releases/tag/python%2Fv0.3.0"
|
|
23
23
|
|
|
24
24
|
[tool.hatch.build.targets.wheel]
|
|
25
25
|
packages = ["src/runapi"]
|
|
@@ -48,10 +48,21 @@ CONTRACT = {
|
|
|
48
48
|
}
|
|
49
49
|
},
|
|
50
50
|
"rules": [{
|
|
51
|
+
"enum": {
|
|
52
|
+
"output_resolution": ["768p"]
|
|
53
|
+
},
|
|
51
54
|
"when": {
|
|
52
|
-
"model": "hailuo-
|
|
55
|
+
"model": "hailuo-2.3-image-to-video-pro",
|
|
56
|
+
"duration_seconds": 10
|
|
57
|
+
}
|
|
58
|
+
}, {
|
|
59
|
+
"enum": {
|
|
60
|
+
"output_resolution": ["768p"]
|
|
53
61
|
},
|
|
54
|
-
"
|
|
62
|
+
"when": {
|
|
63
|
+
"model": "hailuo-2.3-image-to-video-standard",
|
|
64
|
+
"duration_seconds": 10
|
|
65
|
+
}
|
|
55
66
|
}]
|
|
56
67
|
},
|
|
57
68
|
"text-to-video": {
|
|
@@ -77,5 +77,3 @@ class ImageToVideo(Resource):
|
|
|
77
77
|
raise ValidationError(f"last_frame_image_url is not supported for {model}")
|
|
78
78
|
if params.get("prompt_optimizer"):
|
|
79
79
|
raise ValidationError(f"prompt_optimizer is not supported for {model}")
|
|
80
|
-
if duration_seconds == 10 and str(output_resolution) == "1080p":
|
|
81
|
-
raise ValidationError("1080p does not support 10-second duration")
|
|
@@ -82,8 +82,7 @@ def test_create_posts_compacted_body():
|
|
|
82
82
|
"post",
|
|
83
83
|
"/api/v1/hailuo/text_to_video",
|
|
84
84
|
{"model": "hailuo-02-text-to-video-standard", "prompt": "hello world", "duration_seconds": 6},
|
|
85
|
-
)
|
|
86
|
-
]
|
|
85
|
+
)]
|
|
87
86
|
assert isinstance(result, VideoTaskResponse)
|
|
88
87
|
|
|
89
88
|
|
|
@@ -104,10 +103,8 @@ def test_image_to_video_create_posts_compacted_body():
|
|
|
104
103
|
"model": "hailuo-2.3-image-to-video-standard",
|
|
105
104
|
"prompt": "pan the camera",
|
|
106
105
|
"first_frame_image_url": "https://x/a.png",
|
|
107
|
-
"output_resolution": "768p",
|
|
108
|
-
|
|
109
|
-
),
|
|
110
|
-
]
|
|
106
|
+
"output_resolution": "768p"},
|
|
107
|
+
)]
|
|
111
108
|
|
|
112
109
|
|
|
113
110
|
def test_get_fetches_by_id():
|
|
@@ -120,7 +117,7 @@ def test_get_fetches_by_id():
|
|
|
120
117
|
def test_run_narrows_completed_type():
|
|
121
118
|
fake = FakeHttp(
|
|
122
119
|
{"id": "t1", "status": "pending"},
|
|
123
|
-
{"id": "t1", "status": "completed", "videos": [{"url": "https://x/y.mp4"}]},
|
|
120
|
+
{"id": "t1", "status": "completed", "usage": {"cost": 0.05}, "videos": [{"url": "https://x/y.mp4"}]},
|
|
124
121
|
)
|
|
125
122
|
client = HailuoClient(api_key="k", http_client=fake)
|
|
126
123
|
result = client.text_to_video.run(
|
|
@@ -204,7 +201,7 @@ def test_image_to_video_23_rejects_last_frame():
|
|
|
204
201
|
|
|
205
202
|
def test_image_to_video_23_1080p_no_10_second():
|
|
206
203
|
client = HailuoClient(api_key="k", http_client=FakeHttp())
|
|
207
|
-
with pytest.raises(ValidationError, match="
|
|
204
|
+
with pytest.raises(ValidationError, match="output_resolution must be one of: 768p when duration_seconds is 10 and model is hailuo-2.3-image-to-video-.*"):
|
|
208
205
|
client.image_to_video.create(
|
|
209
206
|
model="hailuo-2.3-image-to-video-standard",
|
|
210
207
|
prompt="hi there",
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|